Issue
Description of problem:
targetcli exits with exception when invalid storage_object is passed when creating lun.
Crashes observed with `luns/ create storage_object=` and `storage_object=.`
/iscsi/iqn.20...49601261/tpg1> luns/ create
Missing required parameter storage_object
/iscsi/iqn.20...49601261/tpg1> luns/ create storage_object=/invalid/path/
storage object or path not valid
/iscsi/iqn.20...49601261/tpg1> luns/ create storage_object=something
storage object or path not valid
/iscsi/iqn.20...49601261/tpg1> luns/ create storage_object=.
Traceback (most recent call last):
File "/usr/bin/targetcli", line 329, in <module>
main()
File "/usr/bin/targetcli", line 317, in main
shell.run_interactive()
File "/usr/lib/python3.9/site-packages/configshell_fb/shell.py", line 900, in run_interactive
self._cli_loop()
File "/usr/lib/python3.9/site-packages/configshell_fb/shell.py", line 729, in _cli_loop
self.run_cmdline(cmdline)
File "/usr/lib/python3.9/site-packages/configshell_fb/shell.py", line 843, in run_cmdline
self._execute_command(path, command, pparams, kparams)
File "/usr/lib/python3.9/site-packages/configshell_fb/shell.py", line 818, in _execute_command
result = target.execute_command(command, pparams, kparams)
File "/usr/lib/python3.9/site-packages/configshell_fb/node.py", line 1406, in execute_command
return method(*pparams, **kparams)
File "/usr/lib/python3.9/site-packages/targetcli/ui_target.py", line 1122, in ui_command_create
so = self.get_node(storage_object).rtsnode
AttributeError: 'UILUNs' object has no attribute 'rtsnode'
Version-Release number of selected component (if applicable):
python3-configshell-1:1.1.28-7.el9.noarch
python3-rtslib-2.1.75-1.el9.noarch
targetcli-2.1.53-7.el9.noarch
kernel-5.14.0-283.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1.create iscsi tpg
2.attempt to create lun with `storage_object=`
3.observe exception
Actual results:
targetcli exits with python AttributeError
Expected results:
"storage object or path not valid" message, without exiting targetcli shell
Additional info: