Skip to content

Commit

Permalink
Merge pull request #3711 from cliping/fix-eval
Browse files Browse the repository at this point in the history
Fix a parameter error
  • Loading branch information
chloerh authored Jul 3, 2023
2 parents b663dd1 + acd0597 commit 5254729
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions virttest/utils_libvirt/libvirt_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,26 @@ def check_domjobinfo_items(expected_domjobinfo):
raise exceptions.TestFail("Missing item: {}".format(domjobinfo))

vm_name = params.get("main_vm")
expected_domjobinfo = eval(params.get("expected_domjobinfo"))
expected_domjobinfo_complete = eval(params.get("expected_domjobinfo_complete"))
expected_domjobinfo = eval(params.get("expected_domjobinfo", '{}'))
expected_domjobinfo_complete = eval(params.get("expected_domjobinfo_complete", '{}'))
options = params.get("domjobinfo_options", "")
postcopy_options = params.get("postcopy_options")
remote_ip = params.get("server_ip")

ret_domjobinfo = None
LOG.info("Check domjobinfo output.")
if "src_items" in expected_domjobinfo:
if expected_domjobinfo and "src_items" in expected_domjobinfo:
virsh_args = {"debug": True, "ignore_status": True}
ret_domjobinfo = virsh.domjobinfo(vm_name, options, **virsh_args)
if "--completed" in options:
if "--completed" in options and expected_domjobinfo_complete:
check_domjobinfo_items(expected_domjobinfo_complete["src_items"])
else:
check_domjobinfo_items(expected_domjobinfo["src_items"])
if "dest_items" in expected_domjobinfo:
if expected_domjobinfo and "dest_items" in expected_domjobinfo:
dest_uri = "qemu+ssh://%s/system" % remote_ip
virsh_args = {"debug": True, "ignore_status": True, "uri": dest_uri}
ret_domjobinfo = virsh.domjobinfo(vm_name, options, **virsh_args)
if "--completed" in options:
if "--completed" in options and expected_domjobinfo_complete:
check_domjobinfo_items(expected_domjobinfo_complete["dest_items"])
else:
check_domjobinfo_items(expected_domjobinfo["dest_items"])

0 comments on commit 5254729

Please sign in to comment.