[rhmessaging-commits] rhmessaging commits: r2019 - mgmt/mint/python/mint.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Thu May 8 18:09:09 EDT 2008


Author: nunofsantos
Date: 2008-05-08 18:09:09 -0400 (Thu, 08 May 2008)
New Revision: 2019

Modified:
   mgmt/mint/python/mint/__init__.py
Log:
handle KeyError to allow cumin to receive further updates from broker

Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py	2008-05-08 21:49:39 UTC (rev 2018)
+++ mgmt/mint/python/mint/__init__.py	2008-05-08 22:09:09 UTC (rev 2019)
@@ -367,19 +367,22 @@
     d["recTime"] = datetime.fromtimestamp(timestamps[0]/1000000000)
     d["creationTime"] = datetime.fromtimestamp(timestamps[1]/1000000000)
     self.log(d)
-    for parentKey in self.findParentKeys(d):
-      convertedKey = self.convertRefKey(parentKey)
-      cls = schema.schemaNameToClassMap.get(convertedKey)
-      if cls:
-        d[convertedKey] = conn.getByOriginalId(cls, d.pop(parentKey))
-    obj = conn.getByOriginalId(schema.schemaNameToClassMap[objectName], d["idOriginal"], create=True)
-
     try:
+      for parentKey in self.findParentKeys(d):
+        convertedKey = self.convertRefKey(parentKey)
+        cls = schema.schemaNameToClassMap.get(convertedKey)
+        if cls:
+          d[convertedKey] = conn.getByOriginalId(cls, d.pop(parentKey))
+      obj = conn.getByOriginalId(schema.schemaNameToClassMap[objectName], d["idOriginal"], create=True)
       obj.set(**d)
+      obj.syncUpdate()
     except TypeError, detail:
       self.log("Schema mismatch: %s" % detail)
+      return
+    except KeyError, detail:
+      self.log("Schema mismatch: %s" % detail)
+      return 
 
-    obj.syncUpdate()
     self.log("END CONFIG---------------------------------------------------\n")
     return obj
 




More information about the rhmessaging-commits mailing list