Commit 6a39ca6c by Őry Máté

vm: make cached properties' getters reachable on Node

parent 36e51381
......@@ -54,20 +54,22 @@ class Node(TimeStampedModel):
def __unicode__(self):
@method_cache(10, 5)
def online(self):
def get_online(self):
return self.remote_query(, timeout=1, default=False)
online = property(get_online)
def num_cores(self):
def get_num_cores(self):
"""Number of CPU threads available to the virtual machines.
return self.remote_query(vm_tasks.get_core_num)
num_cores = property(get_num_cores)
def state(self):
"""Node state.
......@@ -94,14 +96,15 @@ class Node(TimeStampedModel):
self.enabled = True
def ram_size(self):
def get_ram_size(self):
"""Bytes of total memory in the node.
return self.remote_query(vm_tasks.get_ram_size)
ram_size = property(get_ram_size)
def ram_size_with_overcommit(self):
"""Bytes of total memory including overcommit margin.
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