Lint: E712 comparison to False should be 'if cond is False:' or 'if not cond:'

This commit is contained in:
Joshua Boniface 2020-11-06 19:35:51 -05:00
parent 72ae149cf1
commit 4d6f36aca0
2 changed files with 10 additions and 10 deletions

View File

@ -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 == False and cfgfile == None: if editor is False and cfgfile == 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 == False and filename == None: if editor is False and filename == 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 == False and filename == None: if editor is False and filename == 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:

View File

@ -294,7 +294,7 @@ class VMInstance(object):
self.logger.out('Failed to stop VM', state='e', prefix='Domain {}'.format(self.domuuid)) self.logger.out('Failed to stop VM', state='e', prefix='Domain {}'.format(self.domuuid))
self.removeDomainFromList() self.removeDomainFromList()
if self.inrestart == False: if self.inrestart is False:
zkhandler.writedata(self.zk_conn, { '/domains/{}/state'.format(self.domuuid): 'stop' }) zkhandler.writedata(self.zk_conn, { '/domains/{}/state'.format(self.domuuid): 'stop' })
self.logger.out('Successfully stopped VM', state='o', prefix='Domain {}'.format(self.domuuid)) self.logger.out('Successfully stopped VM', state='o', prefix='Domain {}'.format(self.domuuid))
@ -662,12 +662,12 @@ class VMInstance(object):
# provision # provision
# Conditional pass one - Are we already performing an action # Conditional pass one - Are we already performing an action
if self.instart == False \ if self.instart is False \
and self.inrestart == False \ and self.inrestart is False \
and self.inmigrate == False \ and self.inmigrate is False \
and self.inreceive == False \ and self.inreceive is False \
and self.inshutdown == False \ and self.inshutdown is False \
and self.instop == False: and self.instop is False:
# Conditional pass two - Is this VM configured to run on this node # Conditional pass two - Is this VM configured to run on this node
if self.node == self.this_node.name: if self.node == self.this_node.name:
# Conditional pass three - Is this VM currently running on this node # Conditional pass three - Is this VM currently running on this node