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:
930d86e
)
fix error if lat and long do not exist for site
author
Scott Baker
<smbaker@gmail.com>
Thu, 26 Jun 2014 17:26:48 +0000
(10:26 -0700)
committer
Scott Baker
<smbaker@gmail.com>
Thu, 26 Jun 2014 17:26:48 +0000
(10:26 -0700)
planetstack/core/dashboard/views/view_common.py
patch
|
blob
|
history
diff --git
a/planetstack/core/dashboard/views/view_common.py
b/planetstack/core/dashboard/views/view_common.py
index
4efb8c2
..
db842cb
100644
(file)
--- a/
planetstack/core/dashboard/views/view_common.py
+++ b/
planetstack/core/dashboard/views/view_common.py
@@
-141,10
+141,16
@@
def getCDNOperatorData(randomizeData = False, wait=True):
cpu=float(max_cpu)/100.0
hotness = max(0.0, ((cpu*RED_LOAD) - BLUE_LOAD)/(RED_LOAD-BLUE_LOAD))
cpu=float(max_cpu)/100.0
hotness = max(0.0, ((cpu*RED_LOAD) - BLUE_LOAD)/(RED_LOAD-BLUE_LOAD))
+ try:
+ lat=float(site.location.longitude)
+ long=float(site.location.longitude)
+ except:
+ lat=0
+ long=0
+
# format it to what that CDN Operations View is expecting
# format it to what that CDN Operations View is expecting
- new_row = {"lat": float(site.location.longitude),
- "long": float(site.location.longitude),
- "lat": float(site.location.latitude),
+ new_row = {"lat": lat,
+ "long": long,
"health": 0,
"numNodes": int(site.nodes.count()),
"activeHPCSlivers": int(stats_row.get("count_hostname", 0)), # measured number of slivers, from bigquery statistics
"health": 0,
"numNodes": int(site.nodes.count()),
"activeHPCSlivers": int(stats_row.get("count_hostname", 0)), # measured number of slivers, from bigquery statistics