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
bd5649a8
authored
Sep 26, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: move Instance.delete_mem_dump to DeleteMemDumpOperation
parent
bc931f31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
circle/vm/models/instance.py
+0
-7
circle/vm/operations.py
+15
-1
No files found.
circle/vm/models/instance.py
View file @
bd5649a8
...
...
@@ -767,13 +767,6 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
def
delete_mem_dump
(
self
,
timeout
=
15
):
queue_name
=
self
.
mem_dump
[
'datastore'
]
.
get_remote_queue_name
(
'storage'
,
'fast'
)
from
storage.tasks.storage_tasks
import
delete_dump
delete_dump
.
apply_async
(
args
=
[
self
.
mem_dump
[
'path'
]],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
def
allocate_node
(
self
):
if
self
.
node
is
None
:
self
.
node
=
self
.
select_node
()
...
...
circle/vm/operations.py
View file @
bd5649a8
...
...
@@ -428,7 +428,7 @@ class DestroyOperation(InstanceOperation):
# Delete mem. dump if exists
try
:
self
.
instance
.
delete_mem_dump
(
)
self
.
instance
.
_delete_mem_dump
(
parent_activity
=
activity
)
except
:
pass
...
...
@@ -446,6 +446,20 @@ class DestroyOperation(InstanceOperation):
task
=
vm_tasks
.
destroy
# if e.libvirtError and "Domain not found" in str(e):
@register_operation
class
DeleteMemDumpOperation
(
RemoteOperationMixin
,
SubOperationMixin
,
InstanceOperation
):
id
=
"_delete_mem_dump"
name
=
_
(
"removing memory dump"
)
task
=
storage_tasks
.
delete_dump
def
_get_remote_queue
(
self
):
return
self
.
instance
.
mem_dump
[
'datastore'
]
.
get_remote_queue_name
(
"storage"
,
"fast"
)
def
_get_remote_args
(
self
,
**
kwargs
):
return
[
self
.
instance
.
mem_dump
[
'path'
]]
@register_operation
class
MigrateOperation
(
InstanceOperation
):
...
...
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