diff --git a/src/cloud/occi/OCCIServer.rb b/src/cloud/occi/OCCIServer.rb index 6e78f16d8e..575a70df09 100644 --- a/src/cloud/occi/OCCIServer.rb +++ b/src/cloud/occi/OCCIServer.rb @@ -275,8 +275,8 @@ post '/network' do # Auth check protected! # Info retrieval from post params - if params['occixml'] - network_info=Crack::XML.parse(params['occixml']) + if params + network_info=Crack::XML.parse(params.to_s) else halt 400, "OCCI XML representation of Virtual Network not present in the request" end diff --git a/src/cloud/occi/lib/ONEOCCIClient.rb b/src/cloud/occi/lib/ONEOCCIClient.rb index e25a637b91..21405a2cdd 100644 --- a/src/cloud/occi/lib/ONEOCCIClient.rb +++ b/src/cloud/occi/lib/ONEOCCIClient.rb @@ -15,8 +15,8 @@ module ONEOCCIClient ####################################################################### # - # - ####################################################################### + # Initialized client library + # ####################################################################### def initialize(endpoint_str=nil, user=nil, pass=nil, debug_flag=false) @debug = debug_flag @@ -102,9 +102,7 @@ module ONEOCCIClient xml=File.read(xmlfile) begin - curl.http_post( - Curl::PostField.content('occixml', xml) - ) + curl.http_post(xml) rescue Exception => e error = OpenNebula::Error.new(e.message) return error @@ -301,3 +299,5 @@ end + +