Commit 5383465a by Bach Dániel

Merge branch 'feature-remove-active-since' into 'master'

Feature Remove Active Since

closes #257
parents 1d2550c7 2aa2bdef
...@@ -1383,7 +1383,6 @@ ...@@ -1383,7 +1383,6 @@
"time_of_suspend": null, "time_of_suspend": null,
"ram_size": 200, "ram_size": 200,
"priority": 10, "priority": 10,
"active_since": null,
"template": null, "template": null,
"access_method": "nx", "access_method": "nx",
"lease": 1, "lease": 1,
...@@ -1413,7 +1412,6 @@ ...@@ -1413,7 +1412,6 @@
"time_of_suspend": null, "time_of_suspend": null,
"ram_size": 200, "ram_size": 200,
"priority": 10, "priority": 10,
"active_since": null,
"template": null, "template": null,
"access_method": "nx", "access_method": "nx",
"lease": 1, "lease": 1,
......
...@@ -244,10 +244,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -244,10 +244,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
verbose_name=_('time of delete'), verbose_name=_('time of delete'),
help_text=_("Proposed time of automatic " help_text=_("Proposed time of automatic "
"deletion.")) "deletion."))
active_since = DateTimeField(blank=True, null=True,
help_text=_("Time stamp of successful "
"boot report."),
verbose_name=_('active since'))
node = ForeignKey(Node, blank=True, null=True, node = ForeignKey(Node, blank=True, null=True,
related_name='instance_set', related_name='instance_set',
help_text=_("Current hypervisor of this instance."), help_text=_("Current hypervisor of this instance."),
...@@ -532,15 +528,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -532,15 +528,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
return self.primary_host.mac if self.primary_host else None return self.primary_host.mac if self.primary_host else None
@property @property
def uptime(self):
"""Uptime of the instance.
"""
if self.active_since:
return timezone.now() - self.active_since
else:
return timedelta() # zero
@property
def os_type(self): def os_type(self):
"""Get the type of the instance's operating system. """Get the type of the instance's operating system.
""" """
...@@ -549,13 +536,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -549,13 +536,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
else: else:
return self.template.os_type return self.template.os_type
def get_age(self):
"""Deprecated. Use uptime instead.
Get age of VM in seconds.
"""
return self.uptime.seconds
@property @property
def waiting(self): def waiting(self):
"""Indicates whether the instance's waiting for an operation to finish. """Indicates whether the instance's waiting for an operation to finish.
......
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