Author: justi9
Date: 2008-07-30 12:35:25 -0400 (Wed, 30 Jul 2008)
New Revision: 2235
Modified:
mgmt/trunk/mint/python/mint/update.py
Log:
Also catch deletes on prop updates, not only stat updates
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-07-30 15:20:43 UTC (rev 2234)
+++ mgmt/trunk/mint/python/mint/update.py 2008-07-30 16:35:25 UTC (rev 2235)
@@ -156,11 +156,17 @@
attrs["creationTime"] = datetime.fromtimestamp \
(self.timestamps[1]/1000000000)
+ if self.timestamps[2] != 0:
+ attrs["deletionTime"] = datetime.fromtimestamp \
+ (self.timestamps[2]/1000000000)
+
try:
obj = self.conn.getObject(cls, id)
except mint.ObjectNotFound:
obj = cls()
+ log.debug("%s(%i) created", cls.__name__, obj.id)
+
#obj.sourceId = id
#obj.sourceBrokerId = self.conn.brokerId
@@ -171,6 +177,9 @@
obj.set(**attrs)
obj.syncUpdate()
+ if obj.deletionTime:
+ log.debug("%s(%i) marked deleted", cls.__name__, obj.id)
+
# XXX refactor this to take advantage of the get/create logic
# above
if isinstance(obj, mint.Broker) and obj.managedBroker:
@@ -225,6 +234,8 @@
statsobj.set(**attrs)
statsobj.syncUpdate()
+ # XXX not sure if this should happen here. makes more sense in
+ # prop update
if self.timestamps[2] != 0:
obj.deletionTime = datetime.fromtimestamp(self.timestamps[2]/1000000000)