tests/vm/basevm.py: use cmd() instead of qmp()
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Fri, 6 Oct 2023 15:41:23 +0000 (18:41 +0300)
committerJohn Snow <jsnow@redhat.com>
Thu, 12 Oct 2023 18:21:44 +0000 (14:21 -0400)
We don't expect failure here and need 'result' object. cmd() is better
in this case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20231006154125.1068348-14-vsementsov@yandex-team.ru
Signed-off-by: John Snow <jsnow@redhat.com>
tests/vm/basevm.py

index a97e23b0ce05c607b2d2afef92efcbb7990eff58..8aef4cff96700f017cfd11d67ca131a7a9903e1a 100644 (file)
@@ -312,8 +312,8 @@ class BaseVM(object):
         self._guest = guest
         # Init console so we can start consuming the chars.
         self.console_init()
-        usernet_info = guest.qmp("human-monitor-command",
-                                 command_line="info usernet").get("return")
+        usernet_info = guest.cmd("human-monitor-command",
+                                 command_line="info usernet")
         self.ssh_port = get_info_usernet_hostfwd_port(usernet_info)
         if not self.ssh_port:
             raise Exception("Cannot find ssh port from 'info usernet':\n%s" % \