Skip to content

Commit

Permalink
virttest/virt_admin.py: Provide better Error Msg
Browse files Browse the repository at this point in the history
-- The Issue
	To ensure the virt-admin interactive shell
	is alive, a "uri" command is executed

	However, the output of this command is
	ignored.

	This makes debugging a failure of this
	command hard.

-- The Fix
	Print the output of the error

Signed-off-by: Slancaster1 <[email protected]>
  • Loading branch information
Slancaster1 committed Aug 30, 2024
1 parent b490b81 commit b3a9cc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions virttest/virt_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,14 @@ def __init__(

# fail if libvirtd is not running
if check_libvirtd:
if self.cmd_status("uri", timeout=60) != 0:
status, out = self.cmd_status_output("uri", timeout=60)
if status != 0:
LOG.debug(
"Persistent virt-admin session is not responding, "
"libvirtd may be dead."
)
self.auto_close = True
raise aexpect.ShellStatusError(virtadmin_exec, "uri")
raise aexpect.ShellStatusError(virtadmin_exec, out)

def cmd_status_output(
self, cmd, timeout=60, internal_timeout=None, print_func=None, safe=False
Expand Down

0 comments on commit b3a9cc3

Please sign in to comment.