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
41d42a18
authored
Feb 24, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
driver: added move_to_trash function
parent
24e73171
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 @
41d42a18
...
...
@@ -79,3 +79,15 @@ def get_storage_stat(path):
free_space_percent
=
100.0
*
free_space
/
all_space
return
{
'free_space'
:
free_space
,
'free_percent'
:
free_space_percent
}
@celery.task
def
move_to_trash
(
datastore
,
disk_name
):
''' Move path to the trash directory.
'''
trash_path
=
path
.
join
(
datastore
,
trash_directory
)
disk_path
=
path
.
join
(
datastore
,
disk_name
)
if
not
path
.
isdir
(
trash_path
):
mkdir
(
trash_path
)
#TODO: trash dir configurable?
move
(
disk_path
,
trash_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