diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-10-06 12:54:59 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-10-06 13:00:30 -0400 |
commit | 5945b8c4a1d7f571853dd9c2f422434aa4e224fb (patch) | |
tree | 8977db0f20dbd44c648c503f496aac8a42742c74 /virtinst/connection.py | |
parent | 56b9f6187b4b1640acb38e39cb1ad69bcf7e3cc7 (diff) | |
download | virt-manager-5945b8c4a1d7f571853dd9c2f422434aa4e224fb.tar.gz |
connection: Drop redundant XML sanitizing
Diffstat (limited to 'virtinst/connection.py')
-rw-r--r-- | virtinst/connection.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/virtinst/connection.py b/virtinst/connection.py index 86305024..ab254866 100644 --- a/virtinst/connection.py +++ b/virtinst/connection.py @@ -46,17 +46,15 @@ def _sanitize_xml(xml): import difflib orig = xml - xml = re.sub("arch='.*'", "arch='i686'", xml) - xml = re.sub("arch=\".*\"", "arch='i686'", xml) - xml = re.sub("domain type='.*'", "domain type='test'", xml) - xml = re.sub("domain type=\".*\"", "domain type='test'", xml) - xml = re.sub("machine type='.*'", "", xml) + xml = re.sub("arch=\".*\"", "arch=\"i686\"", xml) + xml = re.sub("domain type=\".*\"", "domain type=\"test\"", xml) xml = re.sub("machine type=\".*\"", "", xml) xml = re.sub(">exe<", ">hvm<", xml) - logging.debug("virtinst test sanitizing diff\n:%s", - "\n".join(difflib.unified_diff(orig.split("\n"), - xml.split("\n")))) + diff = "\n".join(difflib.unified_diff(orig.split("\n"), + xml.split("\n"))) + if diff: + logging.debug("virtinst test sanitizing diff\n:%s", diff) return xml |