mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 07:03:02 -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)
|
self._add(cat, args, None, check_success=True, **kwargs)
|
||||||
def add_invalid(self, cat, args, **kwargs):
|
def add_invalid(self, cat, args, **kwargs):
|
||||||
if "grep" not in 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)
|
self._add(cat, args, None, check_success=False, **kwargs)
|
||||||
def add_compare(self, cat, args, compbase, **kwargs):
|
def add_compare(self, cat, args, compbase, **kwargs):
|
||||||
self._add(cat, args, compbase,
|
self._add(cat, args, compbase,
|
||||||
|
@ -1183,7 +1183,7 @@ def testUnknownEmulatorDomcapsLookup(monkeypatch):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
seen = False
|
seen = False
|
||||||
def fake_build_from_params(conn, emulator, arch, machine, hvtype):
|
def fake_build_from_params(conn, emulator, arch, machine, _hvtype):
|
||||||
nonlocal seen
|
nonlocal seen
|
||||||
seen = True
|
seen = True
|
||||||
assert arch == "mips"
|
assert arch == "mips"
|
||||||
|
@ -1276,7 +1276,7 @@ class _InitClass(type):
|
|||||||
but without giving us an explicit dep on python 3.6
|
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:
|
if len(args) != 3:
|
||||||
return super().__new__(cls, *args) # pragma: no cover
|
return super().__new__(cls, *args) # pragma: no cover
|
||||||
dummy = kwargs
|
dummy = kwargs
|
||||||
|
@ -636,7 +636,7 @@ class Guest(XMLBuilder):
|
|||||||
capsinfo = self.lookup_capsinfo()
|
capsinfo = self.lookup_capsinfo()
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception("Error fetching machine list for alias "
|
log.exception("Error fetching machine list for alias "
|
||||||
"resolution, assuming mismatch");
|
"resolution, assuming mismatch")
|
||||||
return False
|
return False
|
||||||
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
|
if capsinfo.is_machine_alias(self.os.machine, domcaps.machine):
|
||||||
return True
|
return True
|
||||||
@ -743,7 +743,7 @@ class Guest(XMLBuilder):
|
|||||||
if original_machine_type.startswith(prefix):
|
if original_machine_type.startswith(prefix):
|
||||||
self.os.machine = machine_alias
|
self.os.machine = machine_alias
|
||||||
return
|
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)
|
original_machine_type)
|
||||||
|
|
||||||
def set_smbios_serial_cloudinit(self):
|
def set_smbios_serial_cloudinit(self):
|
||||||
|
@ -54,7 +54,7 @@ class XMLManualAction(object):
|
|||||||
val = self.xpath_value
|
val = self.xpath_value
|
||||||
else:
|
else:
|
||||||
if "=" not in str(xpath):
|
if "=" not in str(xpath):
|
||||||
raise Exception(
|
raise ValueError(
|
||||||
"%s: Setting xpath must be in the form of XPATH=VALUE" %
|
"%s: Setting xpath must be in the form of XPATH=VALUE" %
|
||||||
xpath)
|
xpath)
|
||||||
xpath, val = xpath.rsplit("=", 1)
|
xpath, val = xpath.rsplit("=", 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user