Commit 36538eb0 by Őry Máté

vm: fix boolean comparsions

parent f8bb2ede
......@@ -29,7 +29,7 @@ def node_available(function):
"""Decorate methods to ignore disabled Nodes.
"""
def decorate(self, *args, **kwargs):
if self.enabled is True and self.online is True:
if self.enabled and self.online:
return function(self, *args, **kwargs)
else:
return None
......@@ -106,7 +106,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()
......@@ -148,7 +148,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