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

Display a more meaningful error when targetcli cannot change "dbroot" #104

Closed cvubrugier closed 7 years ago

cvubrugier commented 7 years ago

The "dbroot" configfs parameter allows to set the directory where persistent information are stored by the kernel, such as persistent reservations or ALUA.

Targetcli tries to change the value of the "dbroot" parameter from /var/target/ to /etc/target/. However, if the directory passed to "dbroot" does not exist, the kernel returns an "invalid argument" error:

# targetcli
[Errno 22] Invalid argument

With this patch, a more meaningful message is displayed instead:

# targetcli
Cannot set dbroot to /etc/target. Please check if this directory exists.

This patch fixes issue #103.

Signed-off-by: Christophe Vu-Brugier cvubrugier@fastmail.fm