Permalink
Browse files

rhevm_client (create_vm): do not replace double by single quotes in u…

…ser data

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>

git-svn-id: https://svn.apache.org/repos/asf/incubator/deltacloud/trunk@1178395 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 4722860 commit 9df8b65b72a21ea181e11e3bef0085255122f46c @mfojtik mfojtik committed Oct 3, 2011
Showing with 1 addition and 7 deletions.
  1. +1 −7 server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
@@ -102,12 +102,6 @@ def cluster_version?(cluster_id, major)
(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 @@ def create_vm(template_id, opts={})
#
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

0 comments on commit 9df8b65

Please sign in to comment.