summaryrefslogtreecommitdiff
path: root/virtinst/connection.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2013-10-06 12:54:59 -0400
committerCole Robinson <crobinso@redhat.com>2013-10-06 13:00:30 -0400
commit5945b8c4a1d7f571853dd9c2f422434aa4e224fb (patch)
tree8977db0f20dbd44c648c503f496aac8a42742c74 /virtinst/connection.py
parent56b9f6187b4b1640acb38e39cb1ad69bcf7e3cc7 (diff)
downloadvirt-manager-5945b8c4a1d7f571853dd9c2f422434aa4e224fb.tar.gz
connection: Drop redundant XML sanitizing
Diffstat (limited to 'virtinst/connection.py')
-rw-r--r--virtinst/connection.py14
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