dianlight / hassio-addons

Hassio.io
MIT License
139 stars 48 forks source link

🐛 [SambaNAS] diskinfo raises exception when reading MBR Partition table #223

Closed tr4nt0r closed 7 months ago

tr4nt0r commented 7 months ago

Addon

SambaNAS

Description

diskinfo 2.1.2 throws an error when reading the partitions of an MBR partition. I already reported it and it was fixed in release 3.1.1

Reproduction steps

Start samba-nas addon

Addon Logs

Traceback (most recent call last):
  File "/usr/local/bin/disklist.py", line 15, in <module>
    plist = d.get_partition_list()
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diskinfo/disk.py", line 825, in get_partition_list
    result.append(Partition(os.path.basename(path), _read_file(path + "/dev")))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diskinfo/partition.py", line 116, in __init__
    self.__part_number = int(_read_udev_property(path, "ID_PART_ENTRY_NUMBER="))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

Addon Config

workgroup: WORKGROUP
username: homeassistant
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
  - 169.254.0.0/16
  - fe80::/10
  - fc00::/7
automount: true
moredisks:
  - HDD
mountoptions:
  - nosuid
  - relatime
  - noexec
available_disks_log: true
medialibrary:
  enable: true
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false
recyle_bin_enabled: false
wsdd2: false
mqtt_nexgen_entities: false
autodiscovery: {}
other_users: []
acl:
  - share: config
    disabled: true
interfaces: []
password: **********
log_level: warning
enable_smart: true

Architecture

aarch64

OS

HaOS

dianlight commented 7 months ago

PR #224 merged and released in 12.2.0-nas2.beta73