Clock: Convert to new style XML props

This commit is contained in:
Cole Robinson 2013-07-16 13:12:52 -04:00
parent b18a29d8ff
commit 20a0083635
1 changed files with 4 additions and 21 deletions

View File

@ -21,26 +21,9 @@ from virtinst.xmlbuilder import XMLBuilder, XMLProperty
class Clock(XMLBuilder):
"""
Class for generating <clock> XML
"""
_dumpxml_xpath = "/domain/clock"
def __init__(self, conn, parsexml=None, parsexmlnode=None):
XMLBuilder.__init__(self, conn, parsexml,
parsexmlnode)
_XML_INDENT = 2
_XML_ROOT_NAME = "clock"
_XML_XPATH_RELATIVE = True
self._offset = None
def get_offset(self):
return self._offset
def set_offset(self, val):
self._offset = val
offset = XMLProperty(get_offset, set_offset,
xpath="./clock/@offset")
def _get_xml_config(self):
if not self.offset:
return ""
return """ <clock offset="%s"/>""" % self.offset
offset = XMLProperty(xpath="./clock/@offset")