Fix warnings with latest pep8
This commit is contained in:
parent
cddb9cc426
commit
196ff823b3
|
@ -123,12 +123,10 @@ test_files = {
|
|||
}
|
||||
|
||||
|
||||
|
||||
######################
|
||||
# Test class helpers #
|
||||
######################
|
||||
|
||||
|
||||
class Command(object):
|
||||
"""
|
||||
Instance of a single cli command to test
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
format = pylint
|
||||
|
||||
# E12*: # Continuation line indents
|
||||
# E1* : # Continuation line indents
|
||||
# E203: # Space before : in dictionary defs
|
||||
# E221: # Multiple spaces before operator
|
||||
# (warngs about column aligning assigments)
|
||||
|
@ -11,4 +11,4 @@ format = pylint
|
|||
# E303: # Too many blank lines
|
||||
# E501: # Line too long
|
||||
|
||||
ignore=E121,E122,E123,E124,E125,E126,E127,E128,E203,E221,E241,E301,E303,E501
|
||||
ignore=E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E203,E221,E241,E301,E303,E501
|
||||
|
|
|
@ -188,10 +188,10 @@ class TestStorage(unittest.TestCase):
|
|||
|
||||
# Test creating with many devices
|
||||
# XXX: Need to wire this up
|
||||
#createPool(self.conn,
|
||||
# StoragePool.TYPE_LOGICAL, "pool-logical-manydev",
|
||||
# source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"],
|
||||
# target_path=None)
|
||||
# createPool(self.conn,
|
||||
# StoragePool.TYPE_LOGICAL, "pool-logical-manydev",
|
||||
# source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"],
|
||||
# target_path=None)
|
||||
|
||||
def testDiskPool(self):
|
||||
poolobj = createPool(self.conn,
|
||||
|
|
|
@ -870,7 +870,7 @@ class TestXMLConfig(unittest.TestCase):
|
|||
g.add_device(redir1)
|
||||
g.add_device(redir2)
|
||||
|
||||
#Panic Notifier device
|
||||
# Panic Notifier device
|
||||
pdev = VirtualPanicDevice(g.conn)
|
||||
g.add_device(pdev)
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ from virtinst import Cloner
|
|||
from virtinst.cli import fail, print_stdout, print_stderr
|
||||
|
||||
|
||||
### General input gathering functions
|
||||
# General input gathering functions
|
||||
def get_clone_name(new_name, auto_clone, design):
|
||||
if not new_name and auto_clone:
|
||||
# Generate a name to use
|
||||
|
|
|
@ -33,7 +33,7 @@ from virtinst.cli import fail, print_stdout, print_stderr
|
|||
from virtinst import virtimage
|
||||
|
||||
|
||||
### Option parsing
|
||||
# Option parsing
|
||||
def parse_args():
|
||||
parser = cli.setupParser(
|
||||
"%(prog)s image.xml [OPTIONS]",
|
||||
|
|
|
@ -241,8 +241,8 @@ class OverBox(Gtk.Box):
|
|||
# There's something weird here with destroying this gdk window,
|
||||
# then destroying the over/under widgets. Error seems harmless
|
||||
# but lets shut it up anyways.
|
||||
#self.underWin.destroy()
|
||||
#self.overWin.destroy()
|
||||
# self.underWin.destroy()
|
||||
# self.overWin.destroy()
|
||||
|
||||
self.underWin = None
|
||||
self.overWin = None
|
||||
|
|
|
@ -2439,7 +2439,7 @@ class vmmDetails(vmmGObjectUI):
|
|||
|
||||
# Machine settings
|
||||
machtype = self.vm.get_machtype()
|
||||
if not arch in ["i686", "x86_64"]:
|
||||
if arch not in ["i686", "x86_64"]:
|
||||
if machtype is not None:
|
||||
uiutil.set_combo_entry(self.widget("machine-type"), machtype)
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ class vmmErrorDialog(vmmGObject):
|
|||
logging.debug(debugmsg)
|
||||
|
||||
# Make sure we have consistent details for error dialogs
|
||||
if (dialog_type == Gtk.MessageType.ERROR and not summary in details):
|
||||
if (dialog_type == Gtk.MessageType.ERROR and summary not in details):
|
||||
details = summary + "\n\n" + details
|
||||
|
||||
dialog = _errorDialog(parent=self.get_parent(),
|
||||
|
|
|
@ -301,10 +301,10 @@ class vmmPreferences(vmmGObjectUI):
|
|||
dialog.set_default_size(325, 160)
|
||||
dialog.set_border_width(6)
|
||||
|
||||
infolabel = Gtk.Label(label=
|
||||
_("You can now define grab keys by pressing them.\n"
|
||||
"To confirm your selection please click OK button\n"
|
||||
"while you have desired keys pressed."))
|
||||
infolabel = Gtk.Label(
|
||||
label=_("You can now define grab keys by pressing them.\n"
|
||||
"To confirm your selection please click OK button\n"
|
||||
"while you have desired keys pressed."))
|
||||
keylabel = Gtk.Label(label=_("Please press desired grab key combination"))
|
||||
|
||||
vbox = Gtk.VBox()
|
||||
|
|
|
@ -282,7 +282,7 @@ class vmmSerialConsole(vmmGObject):
|
|||
"connection")
|
||||
elif not vm.is_active():
|
||||
err = _("Serial console not available for inactive guest")
|
||||
elif not ctype in usable_types:
|
||||
elif ctype not in usable_types:
|
||||
err = (_("Console for device type '%s' not yet supported") %
|
||||
ctype)
|
||||
elif (not is_remote and
|
||||
|
|
|
@ -230,7 +230,7 @@ class vmmSystray(vmmGObject):
|
|||
self.populate_vm_list(conn)
|
||||
|
||||
def conn_removed(self, engine_ignore, uri):
|
||||
if not uri in self.conn_menuitems:
|
||||
if uri not in self.conn_menuitems:
|
||||
return
|
||||
|
||||
menu_item = self.conn_menuitems[uri]
|
||||
|
|
|
@ -285,7 +285,7 @@ def _import_file(doc, ctx, conn, input_file):
|
|||
ifaces = []
|
||||
for node in ctx.xpathEval(vhbase % DEVICE_ETHERNET):
|
||||
iface = virtinst.VirtualNetworkInterface(conn)
|
||||
# XXX: Just ignore 'source' info and choose the default
|
||||
# XXX: Just ignore 'source' info and choose the default
|
||||
net_model = _get_child_content(node, "ResourceSubType")
|
||||
if net_model and not net_model.isdigit():
|
||||
iface.model = net_model.lower()
|
||||
|
|
|
@ -226,7 +226,7 @@ class CPU(object):
|
|||
self.threads = 1
|
||||
self.features = CapabilityFeatures()
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -268,7 +268,7 @@ class Host(object):
|
|||
self.topology = None
|
||||
self.secmodels = []
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def get_secmodel(self):
|
||||
|
@ -301,7 +301,7 @@ class Guest(object):
|
|||
|
||||
self.features = CapabilityFeatures()
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -408,7 +408,7 @@ class Topology(object):
|
|||
def __init__(self, node=None):
|
||||
self.cells = []
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -424,7 +424,7 @@ class TopologyCell(object):
|
|||
self.id = None
|
||||
self.cpus = []
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -440,7 +440,7 @@ class TopologyCPU(object):
|
|||
def __init__(self, node=None):
|
||||
self.id = None
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -453,7 +453,7 @@ class SecurityModel(object):
|
|||
self.doi = None
|
||||
self.baselabels = {}
|
||||
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
|
|
@ -117,7 +117,7 @@ def setupLogging(appname, debug_stdout, do_quiet, cli_app=True):
|
|||
quiet = do_quiet
|
||||
|
||||
vi_dir = None
|
||||
if not "VIRTINST_TEST_SUITE" in os.environ:
|
||||
if "VIRTINST_TEST_SUITE" not in os.environ:
|
||||
vi_dir = util.get_cache_dir()
|
||||
|
||||
if vi_dir and not os.access(vi_dir, os.W_OK):
|
||||
|
@ -1421,7 +1421,7 @@ class ParserBoot(VirtCLIParser):
|
|||
# Build boot order
|
||||
boot_order = []
|
||||
for cliname, ignore in opts.orderedopts:
|
||||
if not cliname in inst.os.BOOT_DEVICES:
|
||||
if cliname not in inst.os.BOOT_DEVICES:
|
||||
continue
|
||||
|
||||
del(opts.opts[cliname])
|
||||
|
|
|
@ -167,7 +167,7 @@ def _rhel4_initrd_inject(initrd, injections):
|
|||
file_proc = subprocess.Popen(["file", "-z", initrd],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
if not "ext2 filesystem" in file_proc.communicate()[0]:
|
||||
if "ext2 filesystem" not in file_proc.communicate()[0]:
|
||||
return False
|
||||
except:
|
||||
logging.exception("Failed to file command for rhel4 initrd detection")
|
||||
|
|
|
@ -97,7 +97,7 @@ def _sort(tosort, sortpref=None):
|
|||
sorted_distro_list.sort()
|
||||
sortpref.reverse()
|
||||
for prefer in sortpref:
|
||||
if not prefer in sorted_distro_list:
|
||||
if prefer not in sorted_distro_list:
|
||||
continue
|
||||
sorted_distro_list.remove(prefer)
|
||||
sorted_distro_list.insert(0, prefer)
|
||||
|
|
|
@ -53,7 +53,7 @@ class Image(object):
|
|||
self.descr = None
|
||||
self.version = None
|
||||
self.release = None
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def abspath(self, p):
|
||||
|
@ -97,7 +97,7 @@ class Domain(object):
|
|||
self.memory = None
|
||||
self.interface = 0
|
||||
self.graphics = None
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -151,7 +151,7 @@ class Boot(object):
|
|||
self.drives = []
|
||||
self.arch = None
|
||||
self.features = ImageFeatures()
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
@ -221,7 +221,7 @@ class Disk(object):
|
|||
self.size = None
|
||||
self.use = None
|
||||
self.csum = {}
|
||||
if not node is None:
|
||||
if node is not None:
|
||||
self.parseXML(node)
|
||||
|
||||
def parseXML(self, node):
|
||||
|
|
Loading…
Reference in New Issue