Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d90e9949
authored
Apr 20, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement basic operations
parent
896412ac
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
18 deletions
+8
-18
.idea/workspace.xml
+0
-0
circle/vm/operations.py
+8
-18
No files found.
.idea/workspace.xml
View file @
d90e9949
This diff is collapsed.
Click to expand it.
circle/vm/operations.py
View file @
d90e9949
...
...
@@ -319,8 +319,8 @@ class DestroyOperation(InstanceOperation):
resultant_state
=
'DESTROYED'
os_policy_actions
=
((
"compute"
,
"compute:delete"
),)
def
_operation
(
self
,
activity
,
system
):
pass
def
_operation
(
self
,
request
):
openstack_api
.
nova
.
server_delete
(
request
,
self
.
instance
.
id
)
@register_operation
...
...
@@ -392,8 +392,8 @@ class RebootOperation(InstanceOperation):
accept_states
=
(
'ACTIVE'
,)
os_policy_actions
=
((
"compute"
,
"compute:reboot"
),)
def
_operation
(
self
,
activity
):
pass
def
_operation
(
self
,
request
):
openstack_api
.
nova
.
server_reboot
(
request
,
self
.
instance
.
id
)
@register_operation
...
...
@@ -619,18 +619,8 @@ class SleepOperation(InstanceOperation):
accept_states
=
(
'ACTIVE'
,)
os_policy_actions
=
((
"compute"
,
"compute:suspend"
),)
def
is_preferred
(
self
):
return
(
not
self
.
instance
.
is_base
and
self
.
instance
.
status
==
self
.
instance
.
STATUS
.
RUNNING
)
def
on_abort
(
self
,
activity
,
error
):
if
isinstance
(
error
,
TimeLimitExceeded
):
activity
.
resultant_state
=
None
else
:
activity
.
resultant_state
=
'ERROR'
def
_operation
(
self
,
activity
,
system
):
pass
def
_operation
(
self
,
request
):
openstack_api
.
nova
.
server_suspend
(
request
,
self
.
instance
.
id
)
@register_operation
...
...
@@ -653,8 +643,8 @@ class WakeUpOperation(InstanceOperation):
else
:
activity
.
resultant_state
=
'ERROR'
def
_operation
(
self
,
activity
):
pass
def
_operation
(
self
,
request
):
openstack_api
.
nova
.
server_resume
(
request
,
self
.
instance
.
id
)
@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