Bug 844585 - [FCoE TGT] targetcli cannot save configure on exit
[FCoE TGT] targetcli cannot save configure on exit
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: targetcli (Show other bugs)
x86_64 Linux
urgent Severity urgent
: beta
: ---
Assigned To: Andy Grover
Storage QE
: Regression
Depends On:
  Show dependency treegraph
Reported: 2012-07-31 02:29 EDT by Gris Ge
Modified: 2014-06-18 03:40 EDT (History)
2 users (show)

See Also:
Fixed In Version: targetcli-2.0rc1.fb19-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 06:36:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gris Ge 2012-07-31 02:29:35 EDT
Description of problem:
Got python error when saving configure of targetcli on exit.
Traceback (most recent call last):
  File "/bin/targetcli", line 89, in <module>
  File "/bin/targetcli", line 85, in main
  File "/usr/lib/python2.7/site-packages/targetcli/ui_root.py", line 71, in ui_command_saveconfig
    f.write(json.dumps(RTSRoot().dump(), sort_keys=True, indent=2))
  File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 166, in dump
    d['targets'] = [t.dump() for t in self.targets]
  File "/usr/lib/python2.7/site-packages/rtslib/target.py", line 1486, in dump
    d['tpgs'] = [tpg.dump() for tpg in self.tpgs]
  File "/usr/lib/python2.7/site-packages/rtslib/target.py", line 1315, in dump
    d['node_acls'] =  [acl.dump() for acl in self.node_acls]
  File "/usr/lib/python2.7/site-packages/rtslib/target.py", line 967, in dump
    val = getattr(self, "chap_" + attr, None)
  File "/usr/lib/python2.7/site-packages/rtslib/target.py", line 845, in _get_chap_userid
    value = fread(path).strip()
  File "/usr/lib/python2.7/site-packages/rtslib/utils.py", line 102, in fread
    file_fd = open(path, 'r')
IOError: [Errno 2] No such file or directory: '/sys/kernel/config/target/fc/20:00:00:1b:21:59:12:36/tpgt_1/acls/10:00:00:05:1e:8f:fa:da/auth/userid'

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Setup FCoE target like these commands:
set global auto_add_mapped_luns=false
/backstores/fileio create disk1 /tmp/fcoe-lun1 10240M
/tcm_fc/ create 20:00:00:1b:21:59:12:37
/tcm_fc/ create 20:00:00:1b:21:59:12:36
/tcm_fc/20:00:00:1b:21:59:12:36/luns/ create /backstores/fileio/disk1
/tcm_fc/20:00:00:1b:21:59:12:36/acls/ create 10:00:00:05:1e:8f:fa:db
/tcm_fc/20:00:00:1b:21:59:12:36/acls/ create 10:00:00:05:1e:8f:fa:da
/tcm_fc/20:00:00:1b:21:59:12:36/acls/10:00:00:05:1e:8f:fa:da create 0 0
/tcm_fc/20:00:00:1b:21:59:12:36/acls/10:00:00:05:1e:8f:fa:db create 0 0
/tcm_fc/20:00:00:1b:21:59:12:37/luns/ create /backstores/fileio/disk1
/tcm_fc/20:00:00:1b:21:59:12:37/acls/ create 10:00:00:05:1e:8f:fa:db
/tcm_fc/20:00:00:1b:21:59:12:37/acls/ create 10:00:00:05:1e:8f:fa:da
/tcm_fc/20:00:00:1b:21:59:12:37/acls/10:00:00:05:1e:8f:fa:db create 0 0
/tcm_fc/20:00:00:1b:21:59:12:37/acls/10:00:00:05:1e:8f:fa:da create 0 0
2. exit
Actual results:
failed with python error for non-exists sysfs file.

Expected results:
No error.

Additional info:

As QE, I am also looking forward Dev could check file existence before open it. We need robust code report correct valuable error message, not python error for developer.

Requesting beta blocker. This is must have feature and a regression compare to RHEL 6 fcoe-target-utils.
Comment 1 Andy Grover 2012-10-30 23:47:27 EDT
fixed in Fedora 18, this should get pulled into rhel 7 automatically
Comment 2 Xiaowei Li 2013-02-06 01:54:00 EST
verified with targetcli-2.0rc1.fb19-1.el7.noarch
Comment 3 Ludek Smid 2014-06-13 06:36:27 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.