Lint: E711 comparison to None should be 'if cond is None:'
This commit is contained in:
parent
4d6f36aca0
commit
ce01b41d81
|
@ -682,7 +682,7 @@ def vm_modify(domain, cfgfile, editor, restart):
|
||||||
Modify existing virtual machine DOMAIN, either in-editor or with replacement CONFIG. DOMAIN may be a UUID or name.
|
Modify existing virtual machine DOMAIN, either in-editor or with replacement CONFIG. DOMAIN may be a UUID or name.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if editor is False and cfgfile == None:
|
if editor is False and cfgfile is None:
|
||||||
cleanup(False, 'Either an XML config file or the "--editor" option must be specified.')
|
cleanup(False, 'Either an XML config file or the "--editor" option must be specified.')
|
||||||
|
|
||||||
retcode, vm_information = pvc_vm.vm_info(config, domain)
|
retcode, vm_information = pvc_vm.vm_info(config, domain)
|
||||||
|
@ -2894,7 +2894,7 @@ def provisioner_userdata_modify(name, filename, editor):
|
||||||
Modify existing userdata document NAME, either in-editor or with replacement FILE.
|
Modify existing userdata document NAME, either in-editor or with replacement FILE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if editor is False and filename == None:
|
if editor is False and filename is None:
|
||||||
cleanup(False, 'Either a file or the "--editor" option must be specified.')
|
cleanup(False, 'Either a file or the "--editor" option must be specified.')
|
||||||
|
|
||||||
if editor is True:
|
if editor is True:
|
||||||
|
@ -3073,7 +3073,7 @@ def provisioner_script_modify(name, filename, editor):
|
||||||
Modify existing script NAME, either in-editor or with replacement FILE.
|
Modify existing script NAME, either in-editor or with replacement FILE.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if editor is False and filename == None:
|
if editor is False and filename is None:
|
||||||
cleanup(False, 'Either a file or the "--editor" option must be specified.')
|
cleanup(False, 'Either a file or the "--editor" option must be specified.')
|
||||||
|
|
||||||
if editor is True:
|
if editor is True:
|
||||||
|
|
|
@ -1318,7 +1318,7 @@ def collect_vm_stats(queue):
|
||||||
if debug:
|
if debug:
|
||||||
logger.out("Connecting to libvirt", state='d', prefix='vm-thread')
|
logger.out("Connecting to libvirt", state='d', prefix='vm-thread')
|
||||||
lv_conn = libvirt.open(libvirt_name)
|
lv_conn = libvirt.open(libvirt_name)
|
||||||
if lv_conn == None:
|
if lv_conn is None:
|
||||||
logger.out('Failed to open connection to "{}"'.format(libvirt_name), state='e')
|
logger.out('Failed to open connection to "{}"'.format(libvirt_name), state='e')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ class VMInstance(object):
|
||||||
# Start up a new Libvirt connection
|
# Start up a new Libvirt connection
|
||||||
libvirt_name = "qemu:///system"
|
libvirt_name = "qemu:///system"
|
||||||
lv_conn = libvirt.open(libvirt_name)
|
lv_conn = libvirt.open(libvirt_name)
|
||||||
if lv_conn == None:
|
if lv_conn is None:
|
||||||
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
||||||
self.instart = False
|
self.instart = False
|
||||||
return
|
return
|
||||||
|
@ -254,7 +254,7 @@ class VMInstance(object):
|
||||||
# Start up a new Libvirt connection
|
# Start up a new Libvirt connection
|
||||||
libvirt_name = "qemu:///system"
|
libvirt_name = "qemu:///system"
|
||||||
lv_conn = libvirt.open(libvirt_name)
|
lv_conn = libvirt.open(libvirt_name)
|
||||||
if lv_conn == None:
|
if lv_conn is None:
|
||||||
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
||||||
self.inrestart = False
|
self.inrestart = False
|
||||||
return
|
return
|
||||||
|
@ -752,7 +752,7 @@ class VMInstance(object):
|
||||||
try:
|
try:
|
||||||
# Open a libvirt connection
|
# Open a libvirt connection
|
||||||
lv_conn = libvirt.open(libvirt_name)
|
lv_conn = libvirt.open(libvirt_name)
|
||||||
if lv_conn == None:
|
if lv_conn is None:
|
||||||
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Failed to open local libvirt connection', state='e', prefix='Domain {}'.format(self.domuuid))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue