Add types to backend status messages
Sapan Bhatia [Fri, 23 Jan 2015 16:19:05 +0000 (16:19 +0000)]
planetstack/openstack_observer/syncstep.py

index 72a740c..fd34f55 100644 (file)
@@ -83,15 +83,15 @@ class SyncStep(object):
                 else:
                     self.sync_record(o)
                     o.enacted = datetime.now() # Is this the same timezone? XXX
-                    o.backend_status = "OK"
+                    o.backend_status = "1 - OK"
                     o.save(update_fields=['enacted'])
             except Exception,e:
                 logger.log_exc("sync step failed!")
                 str_e = '%r'%e
                 try:
-                    o.backend_status = self.error_map.map(str_e)
+                    o.backend_status = '2 - %s'%self.error_map.map(str_e)
                 except:
-                    o.backend_status = str_e
+                    o.backend_status = '2 - %s'%str_e
 
                 # TOFIX:
                 # DatabaseError: value too long for type character varying(140)