Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b0e7d502
authored
Sep 26, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: move Instance.get_screenshot to ScreenshotOperation
parent
cd1b2bc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
circle/vm/models/instance.py
+1
-7
circle/vm/operations.py
+2
-4
No files found.
circle/vm/models/instance.py
View file @
b0e7d502
...
@@ -44,7 +44,7 @@ from common.models import (
...
@@ -44,7 +44,7 @@ from common.models import (
create_readable
,
HumanReadableException
,
create_readable
,
HumanReadableException
,
)
)
from
common.operations
import
OperatedMixin
from
common.operations
import
OperatedMixin
from
..tasks
import
vm_tasks
,
agent_tasks
from
..tasks
import
agent_tasks
from
.activity
import
(
ActivityInProgressError
,
instance_activity
,
from
.activity
import
(
ActivityInProgressError
,
instance_activity
,
InstanceActivity
)
InstanceActivity
)
from
.common
import
BaseResourceConfigModel
,
Lease
from
.common
import
BaseResourceConfigModel
,
Lease
...
@@ -835,12 +835,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -835,12 +835,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
return
merged_acts
return
merged_acts
def
get_screenshot
(
self
,
timeout
=
5
):
queue_name
=
self
.
get_remote_queue_name
(
"vm"
,
"fast"
)
return
vm_tasks
.
screenshot
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
def
get_latest_activity_in_progress
(
self
):
def
get_latest_activity_in_progress
(
self
):
try
:
try
:
return
InstanceActivity
.
objects
.
filter
(
return
InstanceActivity
.
objects
.
filter
(
...
...
circle/vm/operations.py
View file @
b0e7d502
...
@@ -1037,7 +1037,7 @@ class DisableOperation(NodeOperation):
...
@@ -1037,7 +1037,7 @@ class DisableOperation(NodeOperation):
@register_operation
@register_operation
class
ScreenshotOperation
(
InstanceOperation
):
class
ScreenshotOperation
(
Remote
InstanceOperation
):
id
=
'screenshot'
id
=
'screenshot'
name
=
_
(
"screenshot"
)
name
=
_
(
"screenshot"
)
description
=
_
(
"Get a screenshot about the virtual machine's console. A "
description
=
_
(
"Get a screenshot about the virtual machine's console. A "
...
@@ -1046,9 +1046,7 @@ class ScreenshotOperation(InstanceOperation):
...
@@ -1046,9 +1046,7 @@ class ScreenshotOperation(InstanceOperation):
acl_level
=
"owner"
acl_level
=
"owner"
required_perms
=
()
required_perms
=
()
accept_states
=
(
'RUNNING'
,
)
accept_states
=
(
'RUNNING'
,
)
task
=
vm_tasks
.
screenshot
def
_operation
(
self
):
return
self
.
instance
.
get_screenshot
(
timeout
=
20
)
@register_operation
@register_operation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment