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): ...@@ -751,7 +751,7 @@ class DiskAddForm(forms.Form):
self.object_pk = kwargs.pop("object_pk") self.object_pk = kwargs.pop("object_pk")
self.user = kwargs.pop("user") self.user = kwargs.pop("user")
super(DiskAddForm, self).__init__(*args, **kwargs) 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 self.initial['object_pk'] = self.object_pk
def clean_size(self): def clean_size(self):
......
...@@ -801,10 +801,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -801,10 +801,9 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
queue=queue_name queue=queue_name
).get(timeout=timeout) ).get(timeout=timeout)
except Exception as e: 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" logger.debug("Domain %s was not found at %s"
% (self.vm_name, queue_name)) % (self.vm_name, queue_name))
pass
else: else:
raise raise
......
...@@ -92,7 +92,7 @@ class Node(TimeStampedModel): ...@@ -92,7 +92,7 @@ class Node(TimeStampedModel):
def disable(self, user=None): def disable(self, user=None):
''' Disable the node.''' ''' Disable the node.'''
if self.enabled is True: if self.enabled:
with node_activity(code_suffix='disable', node=self, user=user): with node_activity(code_suffix='disable', node=self, user=user):
self.enabled = False self.enabled = False
self.save() self.save()
...@@ -132,7 +132,7 @@ class Node(TimeStampedModel): ...@@ -132,7 +132,7 @@ class Node(TimeStampedModel):
self.node_online() self.node_online()
return self.host.hostname + "." + queue_id return self.host.hostname + "." + queue_id
else: else:
if self.enabled is True: if self.enabled:
self.node_offline() self.node_offline()
raise WorkerNotFound() 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