Updated observer.py to read the default Diag object
diff --git a/xos/core/views/observer.py b/xos/core/views/observer.py
index 77f1d1b..ff3ee28 100644
--- a/xos/core/views/observer.py
+++ b/xos/core/views/observer.py
@@ -9,15 +9,17 @@
try:
observer_name = Config().observer_name
except AttributeError:
- observer_name = ''
+ observer_name = 'openstack'
diag = Diag.objects.filter(name=observer_name).first()
if not diag:
return HttpResponse(json.dumps({"health": ":-X", "time": time.time(), "comp": 0}))
t = time.time()
+
d = json.loads(diag.backend_register)
+
comp = d['last_run'] + d['last_duration']*2 + 300
if comp>t:
d['health'] = ':-)'