[rhmessaging-commits] rhmessaging commits: r4361 - mgmt/newdata/mint/python/mint.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Sep 29 14:04:26 EDT 2010


Author: justi9
Date: 2010-09-29 14:04:25 -0400 (Wed, 29 Sep 2010)
New Revision: 4361

Modified:
   mgmt/newdata/mint/python/mint/update.py
Log:
Improve logging for deferred links

Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py	2010-09-29 15:06:52 UTC (rev 4360)
+++ mgmt/newdata/mint/python/mint/update.py	2010-09-29 18:04:25 UTC (rev 4361)
@@ -426,7 +426,7 @@
                 else:
                     col, nvalue = self.process_value(cls, prop, value)
             except MappingException, e:
-                #log.debug(e)
+                log.debug(e)
                 continue
 
             # XXX This optimization will be obsolete when QMF does it
@@ -469,8 +469,8 @@
                 link = DeferredLink(obj, ref)
                 agent.deferred_links_by_id[object_id].append(link)
 
-                msg = "Referenced object %s hasn't appeared yet"
-                raise MappingException(msg % object_id)
+                msg = "Deferring link to object %s %s"
+                raise MappingException(msg % (ref.that_cls, object_id))
 
             value = that._id
 
@@ -560,6 +560,9 @@
 
         self.this._class.sql_update_object.execute(cursor, values, (column,))
 
+        msg = "Realized deferred link to %s via %s"
+        log.debug(msg, that, self.reference)
+
 class AgentUpdate(Update):
     def __init__(self, model, qmf_agent):
         super(AgentUpdate, self).__init__(model)
@@ -606,6 +609,12 @@
 
                 cursor.connection.commit()
 
+    def __repr__(self):
+        name = self.__class__.__name__
+        agent_id = self.get_agent_id()
+
+        return "%s(%s)" % (name, agent_id)
+
 class AgentDelete(AgentUpdate):
     def do_process(self, cursor, stats):
         agent_id = self.get_agent_id()



More information about the rhmessaging-commits mailing list