[PATCH 02 of 11] virt-convert: escape <description>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# HG changeset patch
# User john.levon@xxxxxxx
# Date 1215697436 25200
# Node ID 8691412fa7603514b6c321ec5b09729dedd88bed
# Parent  8f7a10cd096ad71cf5e7d414958a0db6c1b90e63
virt-convert: escape <description>

Make sure to properly escape <description> contents for XML metacharacters.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/virtconv/parsers/virtimage.py b/virtconv/parsers/virtimage.py
--- a/virtconv/parsers/virtimage.py
+++ b/virtconv/parsers/virtimage.py
@@ -18,6 +18,7 @@
 # MA 02110-1301 USA.
 #
 
+from xml.sax.saxutils import escape
 from string import ascii_letters
 import virtconv.formats as formats
 import virtconv.vmcfg as vmcfg
@@ -146,7 +147,7 @@
         out = image_template % {
             "boot_template": boot_xml,
             "name" : vmname,
-            "description" : vm.description,
+            "description" : escape(vm.description),
             "nr_vcpus" : vm.nr_vcpus,
             # Mb to Kb
             "memory" : int(vm.memory) * 1024,

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux