Bug 1064753

Summary: targetcli: root.py:257:restore_from_file:IOError: [Errno 2] No such file or directory: '/etc/target/saveconfig.json'
Product: Red Hat Enterprise Linux 7 Reporter: Bruno Goncalves <bgoncalv>
Component: python-rtslibAssignee: Andy Grover <agrover>
Status: CLOSED CURRENTRELEASE QA Contact: Bruno Goncalves <bgoncalv>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: sitsofe, tlavigne
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:25:58 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 Bruno Goncalves 2014-02-13 09:04:55 UTC
Description of problem:
Traceback trying to restart target service if "/etc/target/saveconfig.json" does not exist.

Version-Release number of selected component (if applicable):
targetcli-2.1.fb31-2.el7.noarch
python-rtslib-2.1.fb45-1.el7.noarch


How reproducible:
100%

Steps to Reproduce:
1.Install targetcli

2.make sure /etc/target/saveconfig.json does not exist

3.restart target service
systemctl restart target

4.# systemctl restart target
Job for target.service failed. See 'systemctl status target.service' and 'journalctl -xn' for details.

Comment 1 Bruno Goncalves 2014-02-13 09:06:07 UTC
root.py:257:restore_from_file:IOError: [Errno 2] No such file or directory: '/etc/target/saveconfig.json'

Traceback (most recent call last):
  File "/usr/bin/targetctl", line 81, in <module>
    main()
  File "/usr/bin/targetctl", line 78, in main
    funcs[sys.argv[1]](savefile)
  File "/usr/bin/targetctl", line 45, in restore
    errors = RTSRoot().restore_from_file(restore_file=from_file)
  File "/usr/lib/python2.7/site-packages/rtslib/root.py", line 257, in restore_from_file
    with open(restore_file, "r") as f:
IOError: [Errno 2] No such file or directory: '/etc/target/saveconfig.json'

Local variables in innermost frame:
restore_file: '/etc/target/saveconfig.json'
self: <rtslib.root.RTSRoot object at 0x7fa9b8e16290>
abort_on_error: False
clear_existing: True

Comment 3 Bruno Goncalves 2014-02-26 12:55:25 UTC
Verified with:

targetcli-2.1.fb34-1.el7.noarch
python-rtslib-2.1.fb46-1.el7.noarch


# systemctl restart target
#

-----


Feb 26 07:52:15 dell-pe840-02 systemd: Stopping Restore LIO kernel target configuration...
Feb 26 07:52:15 dell-pe840-02 systemd: Starting Restore LIO kernel target configuration...
Feb 26 07:52:15 dell-pe840-02 target: No saved config file at /etc/target/saveconfig.json, ok, exiting
Feb 26 07:52:15 dell-pe840-02 systemd: Started Restore LIO kernel target configuration.

Comment 4 Ludek Smid 2014-06-13 11:25:58 UTC
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.