[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/72] scripts/qemu-ga-client: Fix exception handling
From: |
John Snow |
Subject: |
[PULL 22/72] scripts/qemu-ga-client: Fix exception handling |
Date: |
Fri, 18 Jun 2021 19:04:05 -0400 |
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>
---
scripts/qmp/qemu-ga-client | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client
index 566bddc89d..7aba09f0fe 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)
--
2.31.1
- [PULL 16/72] python: add optional FUSE dependencies, (continued)
- [PULL 16/72] python: add optional FUSE dependencies, John Snow, 2021/06/18
- [PULL 30/72] scripts/qemu-ga-client: Add forwarder shim, John Snow, 2021/06/18
- [PULL 35/72] scripts/qmp-shell: fix connect method signature, John Snow, 2021/06/18
- [PULL 32/72] scripts/qmp-shell: Apply flake8 rules, John Snow, 2021/06/18
- [PULL 38/72] scripts/qmp-shell: Use python3-style super(), John Snow, 2021/06/18
- [PULL 03/72] python/qmp: add parse_address classmethod, John Snow, 2021/06/18
- [PULL 04/72] python/qmp: Add qom script rewrites, John Snow, 2021/06/18
- [PULL 13/72] scripts/qom-fuse: use QOMCommand.qom_list(), John Snow, 2021/06/18
- [PULL 18/72] scripts/qom-fuse: add redirection shim to python/qemu/qmp/qom-fuse.py, John Snow, 2021/06/18
- [PULL 20/72] scripts/qemu-ga-client: apply isort rules, John Snow, 2021/06/18
- [PULL 22/72] scripts/qemu-ga-client: Fix exception handling,
John Snow <=
- [PULL 27/72] scripts/qemu-ga-client: add mypy type hints, John Snow, 2021/06/18
- [PULL 26/72] python/qmp: Correct type of QMPReturnValue, John Snow, 2021/06/18
- [PULL 28/72] scripts/qemu-ga-client: move to python/qemu/qmp/qemu_ga_client.py, John Snow, 2021/06/18
- [PULL 36/72] scripts/qmp-shell: remove shadowed variable from _print(), John Snow, 2021/06/18
- [PULL 19/72] python/qmp: add fuse command to 'qom' tools, John Snow, 2021/06/18
- [PULL 37/72] scripts/qmp-shell: use @classmethod where appropriate, John Snow, 2021/06/18
- [PULL 10/72] scripts/qom-fuse: Apply pylint rules, John Snow, 2021/06/18
- [PULL 21/72] scripts/qemu-ga-client: apply (most) flake8 rules, John Snow, 2021/06/18
- [PULL 29/72] python/qemu-ga-client: add entry point, John Snow, 2021/06/18
- [PULL 33/72] scripts/qmp-shell: fix show_banner signature, John Snow, 2021/06/18