open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
73 stars 90 forks source link

Fix fail when target_core_mod doesn't exists #166

Closed nemunaire closed 4 years ago

nemunaire commented 4 years ago

On my systems (Linux 5.2 and 5.4 compiled without any module, but TARGET_CORE built-in), it appears that the directory /sys/module/iscsi_target_mod/ doesn't exist, causing the following error when running targetctl:

[Errno 2] No such file or directory: '/sys/module/target_core_mod/holders'

The proposed commit returns an empty list instead of an exception, when trying to list the content of the directory.