Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
553a35a4
authored
Jul 07, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: implement Disk.restore
requires storagedriver b599a0f
parent
0ac786b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
circle/storage/models.py
+8
-3
circle/storage/tasks/storage_tasks.py
+3
-0
No files found.
circle/storage/models.py
View file @
553a35a4
...
...
@@ -380,11 +380,16 @@ class Disk(AclBase, TimeStampedModel):
self
.
save
()
return
True
def
restore
(
self
,
user
=
None
,
task_uuid
=
None
):
def
restore
(
self
,
user
=
None
,
task_uuid
=
None
,
timeout
=
15
):
"""Recover destroyed disk from trash if possible.
"""
# TODO
pass
queue_name
=
self
.
datastore
.
get_remote_queue_name
(
'storage'
,
priority
=
'slow'
)
logger
.
info
(
"Image:
%
s at Datastore:
%
s recovered from trash."
%
(
self
.
filename
,
self
.
datastore
.
path
))
storage_tasks
.
recover_from_trash
.
apply_async
(
args
=
[
self
.
datastore
.
path
,
self
.
filename
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
def
save_as
(
self
,
user
=
None
,
task_uuid
=
None
,
timeout
=
300
):
"""Save VM as template.
...
...
circle/storage/tasks/storage_tasks.py
View file @
553a35a4
...
...
@@ -72,6 +72,9 @@ def make_free_space(datastore, percent):
def
move_to_trash
(
datastore
,
disk_path
):
pass
@celery.task
(
name
=
'storagedriver.recover_from_trash'
)
def
recover_from_trash
(
datastore
,
disk_path
):
pass
@celery.task
(
name
=
'storagedriver.get_storage_stat'
)
def
get_storage_stat
(
path
):
...
...
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