Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c77c627d
authored
Dec 13, 2017
by
Fukász Rómeó Ervin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard, storage: add new attribute to storage task, change trash in storage detail
parent
57ce6e25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
circle/dashboard/views/storage.py
+9
-3
circle/storage/models.py
+1
-1
circle/storage/tasks/storage_tasks.py
+1
-1
No files found.
circle/dashboard/views/storage.py
View file @
c77c627d
...
...
@@ -267,13 +267,19 @@ class StorageDetail(SuperuserRequiredMixin, UpdateView):
# file stats
data
=
self
.
get_object
()
.
get_file_statistics
()
disk_names
=
[
d
[
'name'
]
for
d
in
data
[
'disks'
]]
destroyed_filenames
=
[
d
.
filename
for
d
in
Disk
.
objects
.
filter
(
filename__in
=
disk_names
,
destroyed
=
None
)]
disks
=
[
d
for
d
in
data
[
'disks'
]
if
d
[
'name'
]
not
in
destroyed_filenames
]
trash
=
[
d
for
d
in
data
[
'disks'
]
if
d
not
in
disks
]
dumps_size
=
sum
(
d
[
'size'
]
for
d
in
data
[
'dumps'
])
trash
=
sum
(
d
[
'size'
]
for
d
in
data
[
'trash'
])
iso_raw
=
sum
(
d
[
'size'
]
for
d
in
data
[
'disks'
]
iso_raw
=
sum
(
d
[
'size'
]
for
d
in
disks
if
d
[
'format'
]
in
(
"iso"
,
"raw"
))
vm_size
=
vm_actual_size
=
template_actual_size
=
0
for
d
in
d
ata
[
'disks'
]
:
for
d
in
d
isks
:
if
d
[
'format'
]
==
"qcow2"
and
d
[
'type'
]
==
"normal"
:
template_actual_size
+=
d
[
'actual_size'
]
else
:
...
...
circle/storage/models.py
View file @
c77c627d
...
...
@@ -197,7 +197,7 @@ class DataStore(Model):
def
get_file_statistics
(
self
,
timeout
=
30
):
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
data
=
storage_tasks
.
get_file_statistics
.
apply_async
(
args
=
[
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
args
=
[
self
.
type
,
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
return
data
...
...
circle/storage/tasks/storage_tasks.py
View file @
c77c627d
...
...
@@ -79,5 +79,5 @@ def get_storage_stat(data_store_type, path):
@celery.task
(
name
=
'storagedriver.get_file_statistics'
)
def
get_file_statistics
(
data
store
):
def
get_file_statistics
(
data
_store_type
,
path_or_pool
):
pass
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