diff --git a/src/flow/lib/EventManager.rb b/src/flow/lib/EventManager.rb index bf0affc67b..b6bc1a68d8 100644 --- a/src/flow/lib/EventManager.rb +++ b/src/flow/lib/EventManager.rb @@ -311,9 +311,21 @@ class EventManager # rubocop:enable Style/GuardClause - xml = Nokogiri::XML(Base64.decode64(content)) - id = xml.xpath('//PARAMETER[POSITION=2]/VALUE').first.text.to_i - ready = xml.xpath('//PARAMETER[POSITION=3]/VALUE').text + xml = Nokogiri::XML(Base64.decode64(content)) + + id = xml.xpath( + '//PARAMETER[POSITION=2 and TYPE=\'IN\']/VALUE' + ).text.to_i + ready = xml.xpath( + '//PARAMETER[POSITION=3 and TYPE=\'IN\']/VALUE' + ).text + + # rubocop:disable Style/StringLiterals + # Remove extra quotes + ready.gsub!("\"", '') + ready.gsub!('"', '') + ready.gsub!(' ', '') + # rubocop:enable Style/StringLiterals next if !ready.match('READY=YES') || !nodes.include?(id) diff --git a/src/flow/oneflow-server.rb b/src/flow/oneflow-server.rb index 0b2707e86c..d876042052 100644 --- a/src/flow/oneflow-server.rb +++ b/src/flow/oneflow-server.rb @@ -364,7 +364,7 @@ post '/service/:id/role/:role_name/action' do return internal_error(rc.message, one_error_to_http(rc.errno)) end - status 200 + status 204 end post '/service/:id/scale' do @@ -380,8 +380,7 @@ post '/service/:id/scale' do return internal_error(rc.message, one_error_to_http(rc.errno)) end - status 201 - body + status 204 end ############################################################################## @@ -668,6 +667,7 @@ post '/service_template/:id/action' do end new_stemplate = OpenNebula::ServiceTemplate.new_with_id(rc, @client) + rc = new_stemplate.info if OpenNebula.is_error?(rc)