Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7002624e
authored
Jul 07, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add recover_from_trash task
parent
7d71f8e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
storagedriver.py
+12
-0
No files found.
storagedriver.py
View file @
7002624e
...
@@ -95,6 +95,18 @@ def move_to_trash(datastore, disk_name):
...
@@ -95,6 +95,18 @@ def move_to_trash(datastore, disk_name):
@celery.task
@celery.task
def
recover_from_trash
(
datastore
,
disk_name
):
''' Recover named disk from the trash directory.
'''
if
path
.
exists
(
path
.
join
(
datastore
,
disk_name
)):
return
False
disk_path
=
path
.
join
(
datastore
,
trash_directory
,
disk_name
)
#TODO: trash dir configurable?
move
(
disk_path
,
datastore
)
return
True
@celery.task
def
make_free_space
(
datastore
,
percent
=
10
):
def
make_free_space
(
datastore
,
percent
=
10
):
''' Check for free space on datastore.
''' Check for free space on datastore.
If free space is less than the given percent
If free space is less than the given percent
...
...
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