Author: justi9
Date: 2010-05-26 16:46:43 -0400 (Wed, 26 May 2010)
New Revision: 3994
Modified:
mgmt/newdata/cumin/model/condor.xml
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
Add group parsing to rosemary; fix up condor schema
Modified: mgmt/newdata/cumin/model/condor.xml
===================================================================
--- mgmt/newdata/cumin/model/condor.xml 2010-05-26 18:19:34 UTC (rev 3993)
+++ mgmt/newdata/cumin/model/condor.xml 2010-05-26 20:46:43 UTC (rev 3994)
@@ -26,7 +26,7 @@
type="sstr"
desc="The Condor version string for the daemon's version"/>
<property name="DaemonStartTime"
- type="absTime" unit="nanosecond"
+ type="absTime" unit="nanosecond" optional="y"
desc="Number of nanoseconds since epoch when the daemon
was started"/>
</group>
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-05-26 18:19:34 UTC (rev 3993)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-05-26 20:46:43 UTC (rev 3994)
@@ -90,9 +90,15 @@
self.sql_schema = SqlSchema(self._model.sql_model, self._name)
def load(self, elem):
+ groups_by_name = dict()
+
+ for child in elem.findall("group"):
+ name = child.get("name")
+ groups_by_name[name] = child
+
for child in elem.findall("class"):
cls = RosemaryClass(self, child.get("name"))
- cls.load(child)
+ cls.load(child, groups_by_name)
def extend(self, elem):
for child in elem.findall("class"):
@@ -229,9 +235,22 @@
SqlUniqueConstraint(self.sql_table, name, cols)
- def load(self, elem):
+ def load(self, elem, groups_by_name):
log.debug("Loading %s", self)
+ for child in elem.findall("group"):
+ name = child.get("name")
+
+ try:
+ self.load_class_components(groups_by_name[name])
+ except KeyError:
+ log.error("Reference to group '%s' invalid", name)
+
+ raise
+
+ self.load_class_components(elem)
+
+ def load_class_components(self, elem):
for child in elem.findall("property"):
name = child.get("name")