From 08e7b7b809fe16e279d56d1d5cc90ff4ab3a06fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantino=20V=C3=A1zquez=20Blanco?= Date: Fri, 25 Sep 2009 14:34:23 +0000 Subject: [PATCH] OCCI network post goes in the body without field name git-svn-id: http://svn.opennebula.org/one/trunk@804 3034c82b-c49b-4eb3-8279-a7acafdc01c0 --- src/cloud/occi/OCCIServer.rb | 4 ++-- src/cloud/occi/lib/ONEOCCIClient.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) 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 + +