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
516a0b21
authored
Oct 02, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: fixing vm_task calls and activity finish messages
parent
8c7219d6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
circle/vm/models.py
+10
-5
No files found.
circle/vm/models.py
View file @
516a0b21
...
@@ -544,8 +544,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -544,8 +544,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
task_uuid
=
task_uuid
act
.
task_uuid
=
task_uuid
act
.
save
()
act
.
save
()
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
vm_tasks
.
stop
.
apply_async
(
args
=
[
self
.
get_vm_desc
()
],
vm_tasks
.
stop
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
def
stop_async
(
self
,
user
=
None
):
def
stop_async
(
self
,
user
=
None
):
"""Execute stop asynchronously.
"""Execute stop asynchronously.
...
@@ -562,6 +563,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -562,6 +563,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
vm_tasks
.
resume
.
apply_async
(
args
=
[
self
.
vm_name
],
vm_tasks
.
resume
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
def
resume_async
(
self
,
user
=
None
):
def
resume_async
(
self
,
user
=
None
):
"""Execute resume asynchronously.
"""Execute resume asynchronously.
...
@@ -577,8 +579,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -577,8 +579,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
task_uuid
=
task_uuid
act
.
task_uuid
=
task_uuid
act
.
save
()
act
.
save
()
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
vm_tasks
.
power_off
.
apply_async
(
args
=
[
self
.
get_vm_desc
()
],
vm_tasks
.
power_off
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
def
poweroff_async
(
self
,
user
=
None
):
def
poweroff_async
(
self
,
user
=
None
):
"""Execute poweroff asynchronously.
"""Execute poweroff asynchronously.
...
@@ -594,8 +597,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -594,8 +597,9 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
task_uuid
=
task_uuid
act
.
task_uuid
=
task_uuid
act
.
save
()
act
.
save
()
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
vm_tasks
.
restart
.
apply_async
(
args
=
[
self
.
get_vm_desc
()
],
vm_tasks
.
restart
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
def
restart_async
(
self
,
user
=
None
):
def
restart_async
(
self
,
user
=
None
):
"""Execute restart asynchronously.
"""Execute restart asynchronously.
...
@@ -611,10 +615,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
...
@@ -611,10 +615,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
task_uuid
=
task_uuid
act
.
task_uuid
=
task_uuid
act
.
save
()
act
.
save
()
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
queue_name
=
self
.
node
.
host
.
hostname
+
".vm"
vm_tasks
.
save_as
.
apply_async
(
args
=
[
self
.
get_vm_desc
()
],
vm_tasks
.
save_as
.
apply_async
(
args
=
[
self
.
vm_name
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
def
save_as_async
(
self
,
user
=
None
):
def
save_as_async
(
self
,
user
=
None
,
task_uuid
=
None
):
"""Execute save_as asynchronously.
"""Execute save_as asynchronously.
"""
"""
local_tasks
.
save_as
.
apply_async
(
args
=
[
self
,
user
],
local_tasks
.
save_as
.
apply_async
(
args
=
[
self
,
user
],
...
...
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