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
4e70ff47
authored
Dec 13, 2017
by
Fukász Rómeó Ervin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: add get_file_statistics ceph implementation
parent
fad6cdd0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
storagedriver.py
+13
-15
No files found.
storagedriver.py
View file @
4e70ff47
...
...
@@ -127,27 +127,25 @@ def get_storage_stat(data_store_type, path):
@celery.task
()
def
get_file_statistics
(
data_store_type
,
datastore
):
def
get_file_statistics
(
data_store_type
,
path_or_pool
):
if
data_store_type
==
'ceph_block'
:
# TODO get proper data
disks
=
[]
dumps
=
[]
trash
=
[]
pool
=
path_or_pool
disk_list
=
list
(
data_store_type
,
str
(
pool
))
disks
=
[
ceph_disk
for
ceph_disk
in
disk_list
if
not
ceph_disk
[
'name'
]
.
endswith
(
'.dump'
)]
dumps
=
[
ceph_disk
for
ceph_disk
in
disk_list
if
ceph_disk
[
'name'
]
.
endswith
(
'.dump'
)]
else
:
disks
=
[
Disk
.
get
(
datastore
,
name
)
.
get_desc
()
for
name
in
listdir
(
datastore
)
ds_path
=
path_or_pool
disks
=
[
Disk
.
get
(
ds_path
,
name
)
.
get_desc
()
for
name
in
listdir
(
ds_path
)
if
not
name
.
endswith
(
".dump"
)
and
not
path
.
isdir
(
path
.
join
(
d
atastore
,
name
))]
not
path
.
isdir
(
path
.
join
(
d
s_path
,
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
))]
'size'
:
path
.
getsize
(
path
.
join
(
ds_path
,
name
))}
for
name
in
listdir
(
ds_path
)
if
name
.
endswith
(
".dump"
)]
return
{
'dumps'
:
dumps
,
'trash'
:
trash
,
'disks'
:
disks
,
}
...
...
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