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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Hide 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):
...
@@ -127,27 +127,25 @@ def get_storage_stat(data_store_type, path):
@celery.task
()
@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'
:
if
data_store_type
==
'ceph_block'
:
# TODO get proper data
pool
=
path_or_pool
disks
=
[]
disk_list
=
list
(
data_store_type
,
str
(
pool
))
dumps
=
[]
disks
=
[
ceph_disk
for
ceph_disk
in
disk_list
trash
=
[]
if
not
ceph_disk
[
'name'
]
.
endswith
(
'.dump'
)]
dumps
=
[
ceph_disk
for
ceph_disk
in
disk_list
if
ceph_disk
[
'name'
]
.
endswith
(
'.dump'
)]
else
:
else
:
disks
=
[
Disk
.
get
(
datastore
,
name
)
.
get_desc
()
ds_path
=
path_or_pool
for
name
in
listdir
(
datastore
)
disks
=
[
Disk
.
get
(
ds_path
,
name
)
.
get_desc
()
for
name
in
listdir
(
ds_path
)
if
not
name
.
endswith
(
".dump"
)
and
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
,
dumps
=
[{
'name'
:
name
,
'size'
:
path
.
getsize
(
path
.
join
(
datastore
,
name
))}
'size'
:
path
.
getsize
(
path
.
join
(
ds_path
,
name
))}
for
name
in
listdir
(
datastore
)
if
name
.
endswith
(
".dump"
)]
for
name
in
listdir
(
ds_path
)
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
{
return
{
'dumps'
:
dumps
,
'dumps'
:
dumps
,
'trash'
:
trash
,
'disks'
:
disks
,
'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