mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-03 01:17:41 +03:00
B OpenNebula/one#6058: Add missing content-type on oneflow-template
and oneflow
cli (#3204)
This commit is contained in:
parent
0491d23135
commit
d8d1409377
@ -28,12 +28,14 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
|
||||
#
|
||||
# @options [Hash] CLI options
|
||||
def client(options)
|
||||
Service::Client.new(
|
||||
flow_client = Service::Client.new(
|
||||
:username => options[:username],
|
||||
:password => options[:password],
|
||||
:url => options[:server],
|
||||
:user_agent => USER_AGENT
|
||||
)
|
||||
flow_client.set_content_type('application/json')
|
||||
flow_client
|
||||
end
|
||||
|
||||
# Get service pool table
|
||||
|
@ -28,12 +28,14 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
|
||||
#
|
||||
# @options [Hash] CLI options
|
||||
def client(options)
|
||||
Service::Client.new(
|
||||
flow_template_client = Service::Client.new(
|
||||
:username => options[:username],
|
||||
:password => options[:password],
|
||||
:url => options[:server],
|
||||
:user_agent => USER_AGENT
|
||||
)
|
||||
flow_template_client.set_content_type('application/json')
|
||||
flow_template_client
|
||||
end
|
||||
|
||||
# Get service template pool
|
||||
|
@ -429,7 +429,7 @@ module Service
|
||||
req = Net::HTTP::Proxy(@host, @port)::Post.new(path)
|
||||
req.body = body
|
||||
|
||||
if path.start_with?('/service_template') && !@content_type.nil?
|
||||
unless @content_type.nil?
|
||||
req.content_type = @content_type
|
||||
end
|
||||
do_request(req)
|
||||
|
Loading…
Reference in New Issue
Block a user