Bug 813676

Summary: Failed to save configuration when targetcli exit
Product: Red Hat Enterprise Linux 6 Reporter: Gris Ge <fge>
Component: python-rtslibAssignee: Andy Grover <agrover>
Status: CLOSED ERRATA QA Contact: Gris Ge <fge>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.3CC: bdonahue, czhang, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:51:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gris Ge 2012-04-18 08:14:55 UTC
Description of problem:
When "exit" from targetcli, got these errors:
====
/tcm_fc/20:00...5:1e:8f:fa:db> exit
Global pref auto_save_on_exit=true
Existing file /etc/target/saveconfig.json backed up to saveconfig.json.backup
Traceback (most recent call last):
  File "/usr/bin/targetcli", line 93, in <module>
    main()
  File "/usr/bin/targetcli", line 89, in main
    root_node.ui_command_saveconfig()
  File "/usr/lib/python2.6/site-packages/targetcli/ui_root.py", line 70, in ui_command_saveconfig
    f.write(json.dumps(RTSRoot().dump(), sort_keys=True, indent=2))
  File "/usr/lib/python2.6/site-packages/rtslib/root.py", line 160, in dump
    d['targets'] = [t.dump() for t in self.targets]
  File "/usr/lib/python2.6/site-packages/rtslib/target.py", line 1453, in dump
    d['tpgs'] = [tpg.dump() for tpg in self.tpgs]
  File "/usr/lib/python2.6/site-packages/rtslib/target.py", line 1283, in dump
    d['node_acls'] =  [acl.dump() for acl in self.node_acls]
  File "/usr/lib/python2.6/site-packages/rtslib/target.py", line 936, in dump
    val = getattr(self, "chap_" + attr, None)
  File "/usr/lib/python2.6/site-packages/rtslib/target.py", line 845, in _get_chap_userid
    value = fread(path).strip()
  File "/usr/lib/python2.6/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:db/auth/userid'
====

This the whole folder contents of /sys/kernel/config/target/fc/20:00:00:1b:21:59:12:36/

http://pastebin.test.redhat.com/85566


Version-Release number of selected component (if applicable):
fcoe-target-utils-2.0rc1.fb10-3.el6.noarch
kernel -262

How reproducible:
100%

Steps to Reproduce:
1. Setup FCoE and try to exit.
2.
3.
  
Actual results:
python complain

Expected results:
configuration saved.

Additional info:

Comment 5 Andy Grover 2012-04-20 05:09:50 UTC
whups, lost acks when I changed components. Please re-ack pm and qe, sorry bout that.

Comment 7 Gris Ge 2012-05-09 08:44:08 UTC
VERIFY for fcoe-target-utils-2.0rc1.fb10-4.el6.noarch.rpm.

configuration saved on exit to /etc/target/saveconfig.json

Comment 9 errata-xmlrpc 2012-06-20 13:51:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0855.html