Commit c9fc8c35 by Chif Gergő

Add vm id in websocket message

parent 20eb7f3f
Pipeline #1082 passed with stage
in 1 minute 40 seconds
......@@ -259,7 +259,8 @@ class Instance(BaseMachineDescriptor):
channels = get_channel_layer()
async_to_sync(channels.group_send)(
str(self.id), {"type": "status_changed",
"status": self.status
"status": self.status,
"vm": str(self.id)
})
self.save()
......
......@@ -31,4 +31,4 @@ class StatusConsumer(WebsocketConsumer):
def status_changed(self, event):
logger.info("Event received")
self.send(text_data=json.dumps({"status": event["status"]}))
self.send(text_data=json.dumps({"vm": event["vm"], "status": event["status"]}))
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