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
8eb937d5
authored
Oct 05, 2016
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-disks-stats' into 'master'
Add detailed file statistics See merge request !14
parents
7b358f8c
950a98e3
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 @
8eb937d5
...
...
@@ -88,6 +88,25 @@ def get_storage_stat(path):
'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
def
move_to_trash
(
datastore
,
disk_name
):
''' Move path to the trash directory.
...
...
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