deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH 11/11] CIMI: Network create minor typo - remove extraneous whitespace when parsing in XML
Date Fri, 06 Apr 2012 16:01:26 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/cimi/model/network.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/lib/cimi/model/network.rb b/server/lib/cimi/model/network.rb
index cf03412..cbfbae0 100644
--- a/server/lib/cimi/model/network.rb
+++ b/server/lib/cimi/model/network.rb
@@ -52,7 +52,7 @@ class CIMI::Model::Network < CIMI::Model::Base
   end
 
   def self.create(request_body, context, type)
-    input = (type == :xml)? XmlSimple.xml_in(request_body, 'ForceArray'=>false) : JSON.parse(request_body)
+    input = (type == :xml)? XmlSimple.xml_in(request_body, {"ForceArray"=>false,"NormaliseSpace"=>2})
: JSON.parse(request_body)
     if input["networkTemplate"]["href"] #template by reference
       network_config, routing_group = get_by_reference(input, context)
     else
@@ -95,7 +95,7 @@ class CIMI::Model::Network < CIMI::Model::Base
 
   def self.get_by_value(request_body, type)
     if type == :xml
-      xml_arrays = XmlSimple.xml_in(request_body)
+      xml_arrays = XmlSimple.xml_in(request_body, {"NormaliseSpace"=>2})
       network_config = NetworkConfiguration.from_xml(XmlSimple.xml_out(xml_arrays["networkTemplate"][0]["networkConfig"][0]))
     else
      json = JSON.parse(request_body)
-- 
1.7.6.5


Mime
View raw message