Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
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
b5078735
authored
Mar 16, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: don't fail if datastore is missing
parent
9ee74088
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
circle/dashboard/views/storage.py
+12
-6
No files found.
circle/dashboard/views/storage.py
View file @
b5078735
...
...
@@ -16,14 +16,16 @@
# with CIRCLE. If not, see <http://www.gnu.org/licenses/>.
from
__future__
import
unicode_literals
,
absolute_import
from
django.db.models
import
Q
from
django.views.generic
import
UpdateView
from
django.contrib
import
messages
from
django.core.urlresolvers
import
reverse
from
django.db.models
import
Q
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.views.generic
import
UpdateView
from
sizefield.utils
import
filesizeformat
from
braces.views
import
SuperuserRequiredMixin
from
sizefield.utils
import
filesizeformat
from
common.models
import
WorkerNotFound
from
storage.models
import
DataStore
,
Disk
from
..tables
import
DiskListTable
from
..forms
import
DataStoreForm
,
DiskForm
...
...
@@ -41,9 +43,13 @@ class StorageDetail(SuperuserRequiredMixin, UpdateView):
context
=
super
(
StorageDetail
,
self
)
.
get_context_data
(
**
kwargs
)
ds
=
self
.
get_object
()
context
[
'stats'
]
=
self
.
_get_stats
()
context
[
'missing_disks'
]
=
ds
.
get_missing_disks
()
context
[
'orphan_disks'
]
=
ds
.
get_orphan_disks
()
try
:
context
[
'stats'
]
=
self
.
_get_stats
()
context
[
'missing_disks'
]
=
ds
.
get_missing_disks
()
context
[
'orphan_disks'
]
=
ds
.
get_orphan_disks
()
except
WorkerNotFound
:
messages
.
error
(
self
.
request
,
_
(
"The DataStore is offline."
))
context
[
'disk_table'
]
=
DiskListTable
(
self
.
get_table_data
(),
request
=
self
.
request
,
template
=
"django_tables2/with_pagination.html"
)
...
...
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