aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-06-04 11:55:24 -0400
committerJohn Snow <jsnow@redhat.com>2021-06-18 16:10:06 -0400
commite6de9ce90a67960a6477da5a5c69c19ce390ed1d (patch)
treebbc218d130a92a0b99cfbe2f82eb603b0a0f8294 /scripts
parente75f516ac131dbc3c82ac52ef527680c4745add3 (diff)
downloadqemu-e6de9ce90a67960a6477da5a5c69c19ce390ed1d.zip
qemu-e6de9ce90a67960a6477da5a5c69c19ce390ed1d.tar.gz
qemu-e6de9ce90a67960a6477da5a5c69c19ce390ed1d.tar.bz2
scripts/qemu-ga-client: Fix exception handling
Fixes: 50d189c These error classes aren't available anymore. Fix the bitrot. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210604155532.1499282-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qmp/qemu-ga-client10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client
index 566bddc..7aba09f 100755
--- a/scripts/qmp/qemu-ga-client
+++ b/scripts/qmp/qemu-ga-client
@@ -56,8 +56,6 @@ class QemuGuestAgent(qmp.QEMUMonitorProtocol):
class QemuGuestAgentClient:
- error = QemuGuestAgent.error
-
def __init__(self, address):
self.qga = QemuGuestAgent(address)
self.qga.connect(negotiate=False)
@@ -137,7 +135,7 @@ class QemuGuestAgentClient:
self.qga.settimeout(timeout)
try:
self.qga.ping()
- except self.qga.timeout:
+ except TimeoutError:
return False
return True
@@ -269,11 +267,11 @@ def main(address, cmd, args):
try:
client = QemuGuestAgentClient(address)
- except QemuGuestAgent.error as e:
+ except OSError as err:
import errno
- print(e)
- if e.errno == errno.ECONNREFUSED:
+ print(err)
+ if err.errno == errno.ECONNREFUSED:
print('Hint: qemu is not running?')
sys.exit(1)