Commit be89911f by Őry Máté

vm: send notification about vm expiring soon

parent 1906a602
...@@ -680,6 +680,11 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -680,6 +680,11 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
failed.append((u, e)) failed.append((u, e))
else: else:
success.append(u) success.append(u)
if self.status == "RUNNING":
token = VmRenewView.get_token_url(self, self.owner)
queue = self.get_remote_queue_name("agent")
agent_tasks.send_expiration.apply_async(
queue=queue, args=(self.vm_name, token))
return True return True
def is_expiring(self, threshold=0.1): def is_expiring(self, threshold=0.1):
......
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