Commit 9d513b83 by Kálmán Viktor

vm: fix screenshot

parent d0ad840c
...@@ -2822,8 +2822,7 @@ class InterfaceDeleteView(DeleteView): ...@@ -2822,8 +2822,7 @@ class InterfaceDeleteView(DeleteView):
def get_vm_screenshot(request, pk): def get_vm_screenshot(request, pk):
instance = get_object_or_404(Instance, pk=pk) instance = get_object_or_404(Instance, pk=pk)
try: try:
image = instance.screenshot(instance=instance, image = instance.screenshot(user=request.user).getvalue()
user=request.user).getvalue()
except: except:
# TODO handle this better # TODO handle this better
raise Http404() raise Http404()
......
...@@ -949,7 +949,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -949,7 +949,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
return merged_acts return merged_acts
def get_screenshot(self, timeout=5): def get_screenshot(self, timeout=5):
queue_name = self.get_remote_queue_name('vm') queue_name = self.get_remote_queue_name("vm", "fast")
return vm_tasks.screenshot.apply_async(args=[self.vm_name], return vm_tasks.screenshot.apply_async(args=[self.vm_name],
queue=queue_name queue=queue_name
).get(timeout=timeout) ).get(timeout=timeout)
...@@ -594,7 +594,7 @@ class ScreenshotOperation(InstanceOperation): ...@@ -594,7 +594,7 @@ class ScreenshotOperation(InstanceOperation):
if self.instance.status not in ['RUNNING']: if self.instance.status not in ['RUNNING']:
raise self.instance.WrongStateError(self.instance) raise self.instance.WrongStateError(self.instance)
def _operation(self, instance, user): def _operation(self):
return self.instance.get_screenshot(timeout=20) return self.instance.get_screenshot(timeout=20)
......
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