Commit 6d8a0fd9 by Kálmán Viktor

Merge branch 'issue-431' into 'master'

Don't notify if the VM is already suspended

closes #431 

See merge request !360
parents 13d89bae 0a40aa8a
......@@ -710,7 +710,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
def _is_suspend_expiring(self, threshold=0.1):
interval = self.lease.suspend_interval
if self.time_of_suspend is not None and interval is not None:
if (self.status != "SUSPENDED" and
self.time_of_suspend is not None and interval is not None):
limit = timezone.now() + timedelta(seconds=(
threshold * self.lease.suspend_interval.total_seconds()))
return limit > self.time_of_suspend
......
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