Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
054e4941
authored
Feb 14, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: method for manually changing instance state
closes #68
parent
9daef8ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
circle/vm/models/instance.py
+10
-1
No files found.
circle/vm/models/instance.py
View file @
054e4941
...
...
@@ -22,7 +22,7 @@ from taggit.managers import TaggableManager
from
acl.models
import
AclBase
from
storage.models
import
Disk
from
..tasks
import
local_tasks
,
vm_tasks
,
agent_tasks
from
.activity
import
instance_activity
from
.activity
import
instance_activity
,
InstanceActivity
from
.common
import
BaseResourceConfigModel
,
Lease
from
.network
import
Interface
from
.node
import
Node
,
Trait
...
...
@@ -273,6 +273,15 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
act
=
None
return
'NOSTATE'
if
act
is
None
else
act
.
resultant_state
def
manual_state_change
(
self
,
new_state
,
reason
=
None
,
user
=
None
):
act
=
InstanceActivity
.
create
(
code_suffix
=
'manual_state_change'
,
instance
=
self
,
user
=
user
)
act
.
finished
=
act
.
started
act
.
result
=
reason
act
.
resultant_state
=
new_state
act
.
succeeded
=
True
act
.
save
()
def
vm_state_changed
(
self
,
new_state
):
pass
...
...
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