diff options
author | John Snow <jsnow@redhat.com> | 2023-02-09 19:31:41 -0500 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2023-02-22 23:35:03 -0500 |
commit | aef633e76504f6f2f3be47a22b271ce6469c0d9d (patch) | |
tree | 3ec6a17f9b0f3f6314cdc8428dad6097f006a43e /python/qemu/utils | |
parent | 79b677d658d3d35e1e776826ac4abb28cdce69b8 (diff) | |
download | qemu-aef633e76504f6f2f3be47a22b271ce6469c0d9d.zip qemu-aef633e76504f6f2f3be47a22b271ce6469c0d9d.tar.gz qemu-aef633e76504f6f2f3be47a22b271ce6469c0d9d.tar.bz2 |
python: support pylint 2.16
Pylint 2.16 adds a few new checks that cause the optional check-tox CI
job to fail.
1. The superfluous-parens check seems to be a bit more aggressive,
2. broad-exception-raised is new; it discourages "raise Exception".
Fix these minor issues and turn the lights green.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Beraldo Leal <bleal@redhat.com>
Message-id: 20230210003147.1309376-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/qemu/utils')
-rw-r--r-- | python/qemu/utils/qemu_ga_client.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_ga_client.py index 8c38a7a..d8411bb 100644 --- a/python/qemu/utils/qemu_ga_client.py +++ b/python/qemu/utils/qemu_ga_client.py @@ -155,7 +155,7 @@ class QemuGuestAgentClient: def fsfreeze(self, cmd: str) -> object: if cmd not in ['status', 'freeze', 'thaw']: - raise Exception('Invalid command: ' + cmd) + raise ValueError('Invalid command: ' + cmd) # Can be int (freeze, thaw) or GuestFsfreezeStatus (status) return getattr(self.qga, 'fsfreeze' + '_' + cmd)() @@ -167,7 +167,7 @@ class QemuGuestAgentClient: def suspend(self, mode: str) -> None: if mode not in ['disk', 'ram', 'hybrid']: - raise Exception('Invalid mode: ' + mode) + raise ValueError('Invalid mode: ' + mode) try: getattr(self.qga, 'suspend' + '_' + mode)() @@ -178,7 +178,7 @@ class QemuGuestAgentClient: def shutdown(self, mode: str = 'powerdown') -> None: if mode not in ['powerdown', 'halt', 'reboot']: - raise Exception('Invalid mode: ' + mode) + raise ValueError('Invalid mode: ' + mode) try: self.qga.shutdown(mode=mode) |