summaryrefslogtreecommitdiff
path: root/virtinst
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2022-12-13 10:51:14 -0500
committerCole Robinson <crobinso@redhat.com>2022-12-13 11:23:45 -0500
commitbb1afaba29019605a240a57d6b3ca8eb36341d9b (patch)
tree41349476a89b5c05727cefa191e95efe4743f28b /virtinst
parent4a2df064839f71ed94320771507b1271d041e397 (diff)
downloadvirt-manager-bb1afaba29019605a240a57d6b3ca8eb36341d9b.tar.gz
Fix pylint/pycodestyle warnings with latest versions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'virtinst')
-rw-r--r--virtinst/cli.py8
-rw-r--r--virtinst/domcapabilities.py2
-rw-r--r--virtinst/pollhelpers.py2
-rw-r--r--virtinst/virtinstall.py20
-rw-r--r--virtinst/xmlbuilder.py6
5 files changed, 19 insertions, 19 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 8dbffeb6..7615f743 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -85,7 +85,7 @@ class VirtHelpFormatter(argparse.RawDescriptionHelpFormatter):
'''
oldwrap = None
- # pylint: disable=arguments-differ
+ # pylint: disable=arguments-differ,protected-access
def _split_lines(self, *args, **kwargs):
def return_default():
return argparse.RawDescriptionHelpFormatter._split_lines(
@@ -1690,7 +1690,7 @@ def convert_old_force(options):
if options.force:
if not options.check:
options.check = "all=off"
- del(options.force)
+ del options.force
class ParserCheck(VirtCLIParser):
@@ -2281,7 +2281,7 @@ class ParserCPU(VirtCLIParser):
policy = "disable"
if policy:
- del(self.optdict[key])
+ del self.optdict[key]
converted[policy].append(key[1:])
self.optdict.update(converted)
@@ -2753,7 +2753,7 @@ class ParserBoot(VirtCLIParser):
if cliname not in inst.BOOT_DEVICES:
continue
- del(self.optdict[cliname])
+ del self.optdict[cliname]
if cliname not in boot_order:
boot_order.append(cliname)
diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index d22ce6a2..1b5b6bf6 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -334,7 +334,7 @@ class DomainCapabilities(XMLBuilder):
"""
Return True if we know how to setup UEFI for the passed arch
"""
- return self.arch in list(self._uefi_arch_patterns.keys())
+ return self.arch in self._uefi_arch_patterns
def supports_uefi_loader(self):
"""
diff --git a/virtinst/pollhelpers.py b/virtinst/pollhelpers.py
index ef695914..f9fcc3fa 100644
--- a/virtinst/pollhelpers.py
+++ b/virtinst/pollhelpers.py
@@ -32,7 +32,7 @@ def _new_poll_helper(origmap, typename, list_cb, build_cb, support_cb):
else:
# Previously known object
current[name] = origmap[name]
- del(origmap[name])
+ del origmap[name]
return (list(origmap.values()), list(new.values()), list(current.values()))
diff --git a/virtinst/virtinstall.py b/virtinst/virtinstall.py
index 8fcc8ce1..130c8e28 100644
--- a/virtinst/virtinstall.py
+++ b/virtinst/virtinstall.py
@@ -67,7 +67,7 @@ def check_cdrom_option_error(options):
def convert_old_printxml(options):
if options.xmlstep:
options.xmlonly = options.xmlstep
- del(options.xmlstep)
+ del options.xmlstep
def convert_old_sound(options):
@@ -135,10 +135,10 @@ def convert_old_disks(options):
else:
_do_convert_old_disks(options)
- del(options.file_paths)
- del(options.disksize)
- del(options.sparse)
- del(options.nodisks)
+ del options.file_paths
+ del options.disksize
+ del options.sparse
+ del options.nodisks
log.debug("Distilled --disk options: %s", options.disk)
@@ -147,7 +147,7 @@ def convert_old_os_options(options):
return
log.warning(
_("--os-type is deprecated and does nothing. Please stop using it."))
- del(options.old_os_type)
+ del options.old_os_type
def convert_old_memory(options):
@@ -204,9 +204,9 @@ def convert_old_networks(options):
networks[idx] = networks[idx].replace(prefix + ":",
prefix + "=")
- del(options.mac)
- del(options.bridge)
- del(options.nonetworks)
+ del options.mac
+ del options.bridge
+ del options.nonetworks
options.network = networks
log.debug("Distilled --network options: %s", options.network)
@@ -224,7 +224,7 @@ def convert_old_graphics(options):
if graphics and (vnc or sdl or keymap or vncport or vnclisten):
fail(_("Cannot mix --graphics and old style graphical options"))
- optnum = sum([bool(g) for g in [vnc, nographics, sdl, graphics]])
+ optnum = sum(bool(g) for g in [vnc, nographics, sdl, graphics])
if optnum > 1:
raise ValueError(_("Can't specify more than one of VNC, SDL, "
"--graphics or --nographics"))
diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py
index 07a9e319..dd78038e 100644
--- a/virtinst/xmlbuilder.py
+++ b/virtinst/xmlbuilder.py
@@ -262,9 +262,9 @@ class XMLProperty(_XMLPropertyBase):
self._is_onoff = is_onoff
self._do_abspath = do_abspath
- conflicts = sum([int(bool(i)) for i in
+ conflicts = sum(int(bool(i)) for i in
[self._is_bool, self._is_int,
- self._is_yesno, self._is_onoff]])
+ self._is_yesno, self._is_onoff])
if conflicts > 1:
raise xmlutil.DevError("Conflict property converter options.")
@@ -343,7 +343,7 @@ class XMLProperty(_XMLPropertyBase):
propstore = xmlbuilder._propstore
if self.propname in propstore:
- del(propstore[self.propname])
+ del propstore[self.propname]
propstore[self.propname] = val
def _nonxml_fget(self, xmlbuilder):