# HG changeset patch # User David Lutterkort <dlutter@xxxxxxxxxx> # Date 1197512462 28800 # Node ID 557938724328c5b26e222f4a79d2e36b3a1e5d80 # Parent 81d9288672cb1e296f4dc09633c8faeee66046b7 Add version information to image.xml diff -r 81d9288672cb -r 557938724328 doc/image.rng --- a/doc/image.rng Tue Dec 11 11:45:06 2007 -0500 +++ b/doc/image.rng Wed Dec 12 18:21:02 2007 -0800 @@ -8,7 +8,12 @@ storage backing the machine --> <element name="image"> <!-- A machine-usable name for this image --> - <element name="name"><ref name="genericName"/></element> + <element name="name"> + <optional> + <attribute name="version"><ref name="verString"/></attribute> + </optional> + <ref name="genericName"/> + </element> <!-- A human-readable label and description, mostly to support UI's --> <optional> @@ -246,4 +251,9 @@ <param name="pattern">[a-zA-Z0-9_\-:./]+</param> </data> </define> + <define name="verString"> + <data type="string"> + <param name="pattern">[0-9\.]+(-[0-9\.]+)?</param> + </data> + </define> </grammar> diff -r 81d9288672cb -r 557938724328 virtinst/ImageParser.py --- a/virtinst/ImageParser.py Tue Dec 11 11:45:06 2007 -0500 +++ b/virtinst/ImageParser.py Wed Dec 12 18:21:02 2007 -0800 @@ -36,6 +36,8 @@ class Image: self.name = None self.label = None self.descr = None + self.version = None + self.release = None if not node is None: self.parseXML(node) @@ -43,6 +45,8 @@ class Image: self.name = xpathString(node, "name") self.label = xpathString(node, "label") self.descr = xpathString(node, "description") + self.version = xpathString(node, "name/@version") + self.release = xpathString(node, "name/@release") for d in node.xpathEval("storage/disk"): disk = Disk(d) if disk.file is None: _______________________________________________ et-mgmt-tools mailing list et-mgmt-tools@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/et-mgmt-tools