git://git.onelab.eu
/
plstackapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6ef7615
)
error handling when HyperCache slice does not exist
author
Scott Baker
<smbaker@gmail.com>
Wed, 30 Apr 2014 16:50:01 +0000
(09:50 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Wed, 30 Apr 2014 16:50:01 +0000
(09:50 -0700)
planetstack/core/plus/views.py
patch
|
blob
|
history
diff --git
a/planetstack/core/plus/views.py
b/planetstack/core/plus/views.py
index
9411712
..
bee590b
100644
(file)
--- a/
planetstack/core/plus/views.py
+++ b/
planetstack/core/plus/views.py
@@
-243,7
+243,7
@@
def getCDNOperatorData(randomizeData = False, wait=True):
bq = PlanetStackAnalytics()
bq = PlanetStackAnalytics()
- rows = bq.get_cached_query_results(bq.compose_latest_query(groupByFields=["%hostname", "event", "%slice"]), wait)
+ rows = bq.get_cached_query_results(bq.compose_latest_query(groupByFields=["%hostname", "event", "%slice"]), wait)
# why did we need %slice ??
# wait=False on the first time the Dashboard is opened. This means we might
# not have any rows yet. The dashboard code polls every 30 seconds, so it
# wait=False on the first time the Dashboard is opened. This means we might
# not have any rows yet. The dashboard code polls every 30 seconds, so it
@@
-259,8
+259,11
@@
def getCDNOperatorData(randomizeData = False, wait=True):
else:
stats_rows = {}
else:
stats_rows = {}
- slice = Slice.objects.get(name=HPC_SLICE_NAME)
- slice_slivers = list(slice.slivers.all())
+ slice = Slice.objects.filter(name=HPC_SLICE_NAME)
+ if slice:
+ slice_slivers = list(slice[0].slivers.all())
+ else:
+ slice_slivers = []
new_rows = {}
for site in Site.objects.all():
new_rows = {}
for site in Site.objects.all():