physical_resources_check: Convert exceptions to strings before concatenation

There might be an occasion where we get the following
error:

TypeError: unsupported operand type(s) for +: 'MonitorProtocolError' and 'str'

So let's try to convert the exception class to a string
first.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 e8d44230
......@@ -29,7 +29,7 @@ def run_physical_resources_check(test, params, env):
try:
o = vm.monitor.human_monitor_cmd("info %s " % info_cmd)
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log = str(e) + "\n"
fail_log += "info/query monitor command failed (%s)" % info_cmd
f_fail.append(fail_log)
logging.error(fail_log)
......@@ -55,7 +55,7 @@ def run_physical_resources_check(test, params, env):
try:
o = vm.monitor.human_monitor_cmd("info %s" % info_cmd)
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log = str(e) + "\n"
fail_log += "info/query monitor command failed (%s)" % info_cmd
f_fail.append(fail_log)
logging.error(fail_log)
......@@ -277,7 +277,7 @@ def run_physical_resources_check(test, params, env):
try:
o = vm.monitor.human_monitor_cmd("info network")
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log = str(e) + "\n"
fail_log += "info/query monitor command failed (network)"
n_fail.append(fail_log)
logging.error(fail_log)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册