Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
950a98e3
authored
8 years ago
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add detailed file statistics
parent
7de1a3f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
storagedriver.py
+19
-0
No files found.
storagedriver.py
View file @
950a98e3
...
@@ -88,6 +88,25 @@ def get_storage_stat(path):
...
@@ -88,6 +88,25 @@ def get_storage_stat(path):
'free_percent'
:
free_space_percent
}
'free_percent'
:
free_space_percent
}
@celery.task
()
def
get_file_statistics
(
datastore
):
disks
=
[
Disk
.
get
(
datastore
,
name
)
.
get_desc
()
for
name
in
listdir
(
datastore
)
if
not
name
.
endswith
((
".dump"
,
"trash"
))]
dumps
=
[{
'name'
:
name
,
'size'
:
path
.
getsize
(
path
.
join
(
datastore
,
name
))}
for
name
in
listdir
(
datastore
)
if
name
.
endswith
(
".dump"
)]
trash
=
[{
'name'
:
name
,
'size'
:
path
.
getsize
(
path
.
join
(
datastore
,
trash_directory
,
name
))}
for
name
in
listdir
(
path
.
join
(
datastore
,
trash_directory
))]
return
{
'dumps'
:
dumps
,
'trash'
:
trash
,
'disks'
:
disks
,
}
@celery.task
@celery.task
def
move_to_trash
(
datastore
,
disk_name
):
def
move_to_trash
(
datastore
,
disk_name
):
''' Move path to the trash directory.
''' Move path to the trash directory.
...
...
This diff is collapsed.
Click to expand it.
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