incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@redhat.com
Subject [PATCH 5/6] rhevm_client (create_vm): do not replace double by single quotes in user data
Date Wed, 28 Sep 2011 22:28:35 GMT
From: David Lutterkort <lutter@redhat.com>

This is unnecessary (Nokogiri will take care of escaping quotes as char
entities) and wrong, since it alters the user data.

Signed-off-by: David Lutterkort <lutter@redhat.com>
---
 .../lib/deltacloud/drivers/rhevm/rhevm_client.rb   |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
index 79d4441..b6704b0 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
@@ -102,12 +102,6 @@ module RHEVM
       (result_xml/'/cluster/version').first[:major].strip == major
     end
 
-    def escape_user_data(data)
-      # Replace " with ' to keep quotes in XML attribute safe
-      data.gsub!(/"/, "'")
-      data
-    end
-
     def create_vm(template_id, opts={})
       opts ||= {}
       builder = Nokogiri::XML::Builder.new do
@@ -130,7 +124,7 @@ module RHEVM
                 #
                 custom_property({
                   :name => "floppyinject",
-                  :value => "#{RHEVM::FILEINJECT_PATH}:#{escape_user_data(Base64.decode64(opts[:user_data]))}",
+                  :value => "#{RHEVM::FILEINJECT_PATH}:#{Base64.decode64(opts[:user_data])}",
                   :regexp => "^.*:.*$"})
               }
             else
-- 
1.7.6


Mime
View raw message