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
4dd90cb8
authored
Dec 11, 2017
by
Fukász Rómeó Ervin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ceph
parents
729c191a
faf064b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletions
+21
-1
disk.py
+1
-1
storagedriver.py
+20
-0
No files found.
disk.py
View file @
4dd90cb8
...
...
@@ -223,7 +223,7 @@ class Disk(object):
try
:
with
open
(
disk_path
,
'wb'
)
as
f
:
for
chunk
in
r
.
iter_content
(
chunk_size
=
chunk_size
):
if
ext
in
(
'gz'
,
'bz'
):
if
ext
in
(
'gz'
,
'bz
2
'
):
chunk
=
decompressor
.
decompress
(
chunk
)
f
.
write
(
chunk
)
actsize
=
f
.
tell
()
...
...
storagedriver.py
View file @
4dd90cb8
...
...
@@ -127,6 +127,26 @@ def get_storage_stat(data_store_type, 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"
)
and
not
path
.
isdir
(
path
.
join
(
datastore
,
name
))]
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
exists
(
data_store_type
,
path
,
disk_name
):
''' Recover named disk from 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