Commit db51287a by Bach Dániel Committed by Bach Dániel

remove 'is True' statements

parent 01eb957e
......@@ -751,7 +751,7 @@ class DiskAddForm(forms.Form):
self.object_pk = kwargs.pop("object_pk")
self.user = kwargs.pop("user")
super(DiskAddForm, self).__init__(*args, **kwargs)
self.initial['is_template'] = 1 if self.is_template is True else 0
self.initial['is_template'] = 1 if self.is_template else 0
self.initial['object_pk'] = self.object_pk
def clean_size(self):
......
......@@ -801,10 +801,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
queue=queue_name
).get(timeout=timeout)
except Exception as e:
if e.libvirtError is True and "Domain not found" in str(e):
if e.libvirtError and "Domain not found" in str(e):
logger.debug("Domain %s was not found at %s"
% (self.vm_name, queue_name))
pass
else:
raise
......
......@@ -92,7 +92,7 @@ class Node(TimeStampedModel):
def disable(self, user=None):
''' Disable the node.'''
if self.enabled is True:
if self.enabled:
with node_activity(code_suffix='disable', node=self, user=user):
self.enabled = False
self.save()
......@@ -132,7 +132,7 @@ class Node(TimeStampedModel):
self.node_online()
return self.host.hostname + "." + queue_id
else:
if self.enabled is True:
if self.enabled:
self.node_offline()
raise WorkerNotFound()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment