summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2023-03-09 11:19:29 -0600
committerTony Asleson <tasleson@redhat.com>2023-03-10 12:51:53 -0600
commit3d854b39bd8c3740eae087c4d46e5f685b368f5e (patch)
treeefd8c19107c71746319546a3fb40656fb93906b1 /daemons
parente79c6feb080f30fc4bb4adbfd69c41ac90b6cde3 (diff)
downloadlvm2-3d854b39bd8c3740eae087c4d46e5f685b368f5e.tar.gz
lvmdbusd: Replace assert with exception
Instead of using an assert we will raise an LvmBug exception
Diffstat (limited to 'daemons')
-rw-r--r--daemons/lvmdbusd/cmdhandler.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index 8bc741dc6..cf2a70875 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -637,7 +637,9 @@ def lvm_full_report_json():
rc, out, err = call(cmd)
# When we have an exported vg the exit code of lvs or fullreport will be 5
if rc == 0 or rc == 5:
- assert(type(out) == dict)
+ if type(out) != dict:
+ raise LvmBug("lvm likely returned invalid JSON, lvm exit code = %d, output = %s, err= %s" %
+ (rc, str(out), str(err)))
return out
raise LvmBug("'fullreport' exited with code '%d'" % rc)