You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/04/06 18:01:26 UTC
[PATCH 11/11] CIMI: Network create minor typo - remove extraneous whitespace when parsing in XML
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@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