diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml index 82e877b45..7f60efaa0 100644 --- a/tests/xmlparse-xml/change-disk-out.xml +++ b/tests/xmlparse-xml/change-disk-out.xml @@ -43,6 +43,10 @@ + 0 + 0 + 0 + 0 5 6 diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py index e5ff398ad..4b074b119 100644 --- a/virtinst/xmlbuilder.py +++ b/virtinst/xmlbuilder.py @@ -487,17 +487,18 @@ class XMLProperty(property): if node: use_xpath = node.nodePath() - if val not in [None, False]: - if not node: - node = _build_xpath_node(root_node, use_xpath) - - if val is True: - # Boolean property, creating the node is enough - pass - else: - node.setContent(util.xml_escape(str(val))) - else: + if val is None or val is False: _remove_xpath_node(root_node, use_xpath) + continue + + if not node: + node = _build_xpath_node(root_node, use_xpath) + + if val is True: + # Boolean property, creating the node is enough + continue + node.setContent(util.xml_escape(str(val))) + def refresh_xml(self, xmlbuilder): self.fset(xmlbuilder, self.fget(xmlbuilder), local=False)