Revision 78f99abb lib/ovf.py
b/lib/ovf.py | ||
---|---|---|
833 | 833 |
raw_string = ET.tostring(self.tree) |
834 | 834 |
parsed_xml = xml.dom.minidom.parseString(raw_string) |
835 | 835 |
xml_string = parsed_xml.toprettyxml(indent=" ") |
836 |
text_re = re.compile(">\n\s+([^<>\s].*?)\n\s+</", re.DOTALL) |
|
837 |
return text_re.sub(">\g<1></", xml_string) |
|
836 |
text_re = re.compile(r">\n\s+([^<>\s].*?)\n\s+</", re.DOTALL)
|
|
837 |
return text_re.sub(r">\g<1></", xml_string)
|
|
838 | 838 |
|
839 | 839 |
|
840 | 840 |
class Converter(object): |
... | ... | |
1408 | 1408 |
_, disk_path = self._CompressDisk(disk_path, disk_compression, |
1409 | 1409 |
DECOMPRESS) |
1410 | 1410 |
disk, _ = os.path.splitext(disk) |
1411 |
if self._GetDiskQemuInfo(disk_path, "file format: (\S+)") != "raw": |
|
1411 |
if self._GetDiskQemuInfo(disk_path, r"file format: (\S+)") != "raw":
|
|
1412 | 1412 |
logging.info("Conversion to raw format is required") |
1413 | 1413 |
ext, new_disk_path = self._ConvertDisk("raw", disk_path) |
1414 | 1414 |
|
... | ... | |
1710 | 1710 |
ext, new_disk_path = self._ConvertDisk(self.options.disk_format, disk_path) |
1711 | 1711 |
results["format"] = self.options.disk_format |
1712 | 1712 |
results["virt-size"] = self._GetDiskQemuInfo( |
1713 |
new_disk_path, "virtual size: \S+ \((\d+) bytes\)") |
|
1713 |
new_disk_path, r"virtual size: \S+ \((\d+) bytes\)")
|
|
1714 | 1714 |
if compression: |
1715 | 1715 |
ext2, new_disk_path = self._CompressDisk(new_disk_path, "gzip", |
1716 | 1716 |
COMPRESS) |
Also available in: Unified diff