mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmdbusd: Handle exported VG(s)
When a VG is exported, the 'fullreport' returns an exit code of 5, but otherwise returns the data we are wanting. Signed-off-by: Tony Asleson <tasleson@redhat.com>
This commit is contained in:
parent
ab1f1a306b
commit
5bdcafff47
@ -497,7 +497,8 @@ def lvm_full_report_json():
|
|||||||
])
|
])
|
||||||
|
|
||||||
rc, out, err = call(cmd)
|
rc, out, err = call(cmd)
|
||||||
if rc == 0:
|
# When we have an exported vg the exit code of lvs or fullreport will be 5
|
||||||
|
if rc == 0 or rc == 5:
|
||||||
# With the current implementation, if we are using the shell then we
|
# With the current implementation, if we are using the shell then we
|
||||||
# are using JSON and JSON is returned back to us as it was parsed to
|
# are using JSON and JSON is returned back to us as it was parsed to
|
||||||
# figure out if we completed OK or not
|
# figure out if we completed OK or not
|
||||||
|
@ -220,7 +220,10 @@ class LVMShellProxy(object):
|
|||||||
|
|
||||||
# Parse the report to see what happened
|
# Parse the report to see what happened
|
||||||
if 'log' in report_json:
|
if 'log' in report_json:
|
||||||
if report_json['log'][-1:][0]['log_ret_code'] == '1':
|
ret_code = int(report_json['log'][-1:][0]['log_ret_code'])
|
||||||
|
# If we have an exported vg we get a log_ret_code == 5 when
|
||||||
|
# we do a 'fullreport'
|
||||||
|
if (ret_code == 1) or (ret_code == 5 and argv[0] == 'fullreport'):
|
||||||
rc = 0
|
rc = 0
|
||||||
else:
|
else:
|
||||||
error_msg = self.get_error_msg()
|
error_msg = self.get_error_msg()
|
||||||
|
Loading…
Reference in New Issue
Block a user