Commit 7f6baffa by Őry Máté

dashboard: create activity on console access

parent 9a4d49e4
...@@ -182,10 +182,12 @@ class VmDetailVncTokenView(CheckedDetailView): ...@@ -182,10 +182,12 @@ class VmDetailVncTokenView(CheckedDetailView):
if not self.object.has_level(request.user, 'operator'): if not self.object.has_level(request.user, 'operator'):
raise PermissionDenied() raise PermissionDenied()
if self.object.node: if self.object.node:
with instance_activity(code_suffix='console-accessed',
instance=self.object, user=request.user,
concurrency_check=False):
port = self.object.vnc_port port = self.object.vnc_port
host = str(self.object.node.host.ipv4) host = str(self.object.node.host.ipv4)
value = signing.dumps({'host': host, value = signing.dumps({'host': host, 'port': port},
'port': port},
key=getenv("PROXY_SECRET", 'asdasd')), key=getenv("PROXY_SECRET", 'asdasd')),
return HttpResponse('vnc/?d=%s' % value) return HttpResponse('vnc/?d=%s' % value)
else: else:
......
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