From 9a5b903086ea23350a6b219d2d0a01594e039268 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 2 Sep 2018 09:02:32 -0400 Subject: domain: features: Add set_defaults And move all the Guest logic there. We need to add an xmlbuilder helper _prop_is_unset to be able to determine if a bool property is unset, in our quest to remove default_* xmlbuilder bits --- virtinst/xmlbuilder.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'virtinst/xmlbuilder.py') diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py index e02b42de..7f520add 100644 --- a/virtinst/xmlbuilder.py +++ b/virtinst/xmlbuilder.py @@ -744,6 +744,14 @@ class XMLBuilder(object): self._xmlstate.xmlapi.node_force_remove(xpath) self._set_child_xpaths() + def _prop_is_unset(self, propname): + """ + Return True if the property name has never had a value set + """ + if getattr(self, propname): + return False + return propname not in self._propstore + ################################# # Private XML building routines # -- cgit v1.2.1