Lint: E711 comparison to None should be 'if cond is not None:'
This commit is contained in:
@ -1337,7 +1337,7 @@ def collect_vm_stats(queue):
|
||||
memprov += instance.getmemory()
|
||||
vcpualloc += instance.getvcpus()
|
||||
if instance.getstate() == 'start' and instance.getnode() == this_node.name:
|
||||
if instance.getdom() != None:
|
||||
if instance.getdom() is not None:
|
||||
try:
|
||||
if instance.getdom().state()[0] != libvirt.VIR_DOMAIN_RUNNING:
|
||||
raise
|
||||
|
@ -638,7 +638,7 @@ class VMInstance(object):
|
||||
|
||||
# Check the current state of the VM
|
||||
try:
|
||||
if self.dom != None:
|
||||
if self.dom is not None:
|
||||
running, reason = self.dom.state()
|
||||
else:
|
||||
raise
|
||||
@ -766,7 +766,7 @@ class VMInstance(object):
|
||||
# After everything
|
||||
finally:
|
||||
# Close the libvirt connection
|
||||
if lv_conn != None:
|
||||
if lv_conn is not None:
|
||||
lv_conn.close()
|
||||
|
||||
# Return the dom object (or None)
|
||||
|
Reference in New Issue
Block a user