[rhmessaging-commits] rhmessaging commits: r4286 - mgmt/newdata/rosemary/python/rosemary.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Sep 14 14:05:45 EDT 2010


Author: eallen
Date: 2010-09-14 14:05:44 -0400 (Tue, 14 Sep 2010)
New Revision: 4286

Modified:
   mgmt/newdata/rosemary/python/rosemary/model.py
Log:
Fix BZ 633946: Return None or 0 if that is the actual attribute. Only use a default attribute if the requested attribute is missing.

Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py	2010-09-14 14:43:58 UTC (rev 4285)
+++ mgmt/newdata/rosemary/python/rosemary/model.py	2010-09-14 18:05:44 UTC (rev 4286)
@@ -769,10 +769,12 @@
         return formatter and formatter(value) or value
 
     def get_value(self, attr):
-        value = getattr(self, attr, None)
-        if not value:
+        try:
+            value = getattr(self, attr)
+        except AttributeError:
             # there is no attr, return the value of the 1st property
             value = getattr(self, self._class._properties[0].name)
+
         return value
 
     def __repr__(self):



More information about the rhmessaging-commits mailing list