1
0
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:
Miguel E. Ruiz 2024-09-03 17:49:48 +02:00 committed by GitHub
parent 0491d23135
commit d8d1409377
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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)