Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1e70ee0c
authored
Dec 05, 2015
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard, storage: minimal rework of StorageDetail view for multi data store mode
parent
3dc284a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
11 deletions
+9
-11
circle/dashboard/views/storage.py
+0
-3
circle/storage/models.py
+4
-3
circle/storage/tasks/periodic_tasks.py
+2
-2
circle/storage/tasks/storage_tasks.py
+3
-3
No files found.
circle/dashboard/views/storage.py
View file @
1e70ee0c
...
...
@@ -84,9 +84,6 @@ class StorageDetail(SuperuserRequiredMixin, UpdateView):
form_class
=
DataStoreForm
template_name
=
"dashboard/storage/detail.html"
def
get_object
(
self
):
return
DataStore
.
get_default_datastore
()
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
StorageDetail
,
self
)
.
get_context_data
(
**
kwargs
)
...
...
circle/storage/models.py
View file @
1e70ee0c
...
...
@@ -133,7 +133,7 @@ class DataStore(Model):
"""
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
files
=
set
(
storage_tasks
.
list_files
.
apply_async
(
args
=
[
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
args
=
[
self
.
type
,
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
set
([
disk
.
filename
for
disk
in
self
.
disk_set
.
all
()])
orphans
=
[]
...
...
@@ -148,8 +148,9 @@ class DataStore(Model):
"""
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
files
=
set
(
storage_tasks
.
list_files
.
apply_async
(
args
=
[
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
Disk
.
objects
.
filter
(
destroyed__isnull
=
True
,
is_ready
=
True
)
args
=
[
self
.
type
,
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
Disk
.
objects
.
filter
(
destroyed__isnull
=
True
,
is_ready
=
True
,
datastore
=
self
)
return
disks
.
exclude
(
filename__in
=
files
)
@classmethod
...
...
circle/storage/tasks/periodic_tasks.py
View file @
1e70ee0c
...
...
@@ -64,7 +64,7 @@ def list_orphan_disks(timeout=15):
for
ds
in
DataStore
.
objects
.
all
():
queue_name
=
ds
.
get_remote_queue_name
(
'storage'
,
"slow"
)
files
=
set
(
storage_tasks
.
list_files
.
apply_async
(
args
=
[
ds
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
args
=
[
ds
.
type
,
ds
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
set
([
disk
.
filename
for
disk
in
ds
.
disk_set
.
all
()])
for
i
in
files
-
disks
:
if
not
re
.
match
(
'cloud-[0-9]*
\
.dump'
,
i
):
...
...
@@ -81,7 +81,7 @@ def list_missing_disks(timeout=15):
for
ds
in
DataStore
.
objects
.
all
():
queue_name
=
ds
.
get_remote_queue_name
(
'storage'
,
"slow"
)
files
=
set
(
storage_tasks
.
list_files
.
apply_async
(
args
=
[
ds
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
args
=
[
ds
.
type
,
ds
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
))
disks
=
set
([
disk
.
filename
for
disk
in
ds
.
disk_set
.
filter
(
destroyed__isnull
=
True
)])
for
i
in
disks
-
files
:
...
...
circle/storage/tasks/storage_tasks.py
View file @
1e70ee0c
...
...
@@ -19,12 +19,12 @@ from manager.mancelery import celery
@celery.task
(
name
=
'storagedriver.list'
)
def
list
(
dir
):
def
list
(
d
ata_store_type
,
d
ir
):
pass
@celery.task
(
name
=
'storagedriver.list_files'
)
def
list_files
(
dir
):
def
list_files
(
d
ata_store_type
,
d
ir
):
pass
...
...
@@ -54,7 +54,7 @@ def snapshot(disk_desc):
@celery.task
(
name
=
'storagedriver.get'
)
def
get
(
path
):
def
get
(
json_data
):
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