mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-18 06:03:39 +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
|
# @options [Hash] CLI options
|
||||||
def client(options)
|
def client(options)
|
||||||
Service::Client.new(
|
flow_client = Service::Client.new(
|
||||||
:username => options[:username],
|
:username => options[:username],
|
||||||
:password => options[:password],
|
:password => options[:password],
|
||||||
:url => options[:server],
|
:url => options[:server],
|
||||||
:user_agent => USER_AGENT
|
:user_agent => USER_AGENT
|
||||||
)
|
)
|
||||||
|
flow_client.set_content_type('application/json')
|
||||||
|
flow_client
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get service pool table
|
# Get service pool table
|
||||||
|
@ -28,12 +28,14 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
|
|||||||
#
|
#
|
||||||
# @options [Hash] CLI options
|
# @options [Hash] CLI options
|
||||||
def client(options)
|
def client(options)
|
||||||
Service::Client.new(
|
flow_template_client = Service::Client.new(
|
||||||
:username => options[:username],
|
:username => options[:username],
|
||||||
:password => options[:password],
|
:password => options[:password],
|
||||||
:url => options[:server],
|
:url => options[:server],
|
||||||
:user_agent => USER_AGENT
|
:user_agent => USER_AGENT
|
||||||
)
|
)
|
||||||
|
flow_template_client.set_content_type('application/json')
|
||||||
|
flow_template_client
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get service template pool
|
# Get service template pool
|
||||||
|
@ -429,7 +429,7 @@ module Service
|
|||||||
req = Net::HTTP::Proxy(@host, @port)::Post.new(path)
|
req = Net::HTTP::Proxy(@host, @port)::Post.new(path)
|
||||||
req.body = body
|
req.body = body
|
||||||
|
|
||||||
if path.start_with?('/service_template') && !@content_type.nil?
|
unless @content_type.nil?
|
||||||
req.content_type = @content_type
|
req.content_type = @content_type
|
||||||
end
|
end
|
||||||
do_request(req)
|
do_request(req)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user