mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-06 14:13:28 -06:00
Fix some pylint
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
ccd4757533
commit
0f706cf874
@ -455,7 +455,7 @@ class App(object):
|
||||
self._add(cat, args, None, check_success=True, **kwargs)
|
||||
def add_invalid(self, cat, args, **kwargs):
|
||||
if "grep" not in kwargs:
|
||||
raise Exception("grep= must be passed for add_invalid")
|
||||
raise RuntimeError("grep= must be passed for add_invalid")
|
||||
self._add(cat, args, None, check_success=False, **kwargs)
|
||||
def add_compare(self, cat, args, compbase, **kwargs):
|
||||
self._add(cat, args, compbase,
|
||||
|
@ -1183,7 +1183,7 @@ def testUnknownEmulatorDomcapsLookup(monkeypatch):
|
||||
"""
|
||||
|
||||
seen = False
|
||||
def fake_build_from_params(conn, emulator, arch, machine, hvtype):
|
||||
def fake_build_from_params(conn, emulator, arch, machine, _hvtype):
|
||||
nonlocal seen
|
||||
seen = True
|
||||
assert arch == "mips"
|
||||
|
@ -1276,7 +1276,7 @@ class _InitClass(type):
|
||||
but without giving us an explicit dep on python 3.6
|
||||
|
||||
"""
|
||||
def __new__(cls, *args, **kwargs):
|
||||
def __new__(cls, *args, **kwargs): # pylint: disable=bad-mcs-classmethod-argument
|
||||
if len(args) != 3:
|
||||
return super().__new__(cls, *args) # pragma: no cover
|
||||
dummy = kwargs
|
||||
|
@ -636,7 +636,7 @@ class Guest(XMLBuilder):
|
||||
capsinfo = self.lookup_capsinfo()
|
||||
except Exception:
|
||||
log.exception("Error fetching machine list for alias "
|
||||
"resolution, assuming mismatch");
|
||||
"resolution, assuming mismatch")
|
||||
return False
|
||||
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
|
||||
return True
|
||||
@ -743,7 +743,7 @@ class Guest(XMLBuilder):
|
||||
if original_machine_type.startswith(prefix):
|
||||
self.os.machine = machine_alias
|
||||
return
|
||||
raise Exception("Don't know how to refresh machine type '%s'" %
|
||||
raise RuntimeError("Don't know how to refresh machine type '%s'" %
|
||||
original_machine_type)
|
||||
|
||||
def set_smbios_serial_cloudinit(self):
|
||||
|
@ -54,7 +54,7 @@ class XMLManualAction(object):
|
||||
val = self.xpath_value
|
||||
else:
|
||||
if "=" not in str(xpath):
|
||||
raise Exception(
|
||||
raise ValueError(
|
||||
"%s: Setting xpath must be in the form of XPATH=VALUE" %
|
||||
xpath)
|
||||
xpath, val = xpath.rsplit("=", 1)
|
||||
|
Loading…
Reference in New Issue
Block a user