Skip to content

Commit

Permalink
B #6058: Add missing content-type on oneflow-template and oneflow
Browse files Browse the repository at this point in the history
… cli (#3204)
  • Loading branch information
MiguelERuiz authored Sep 3, 2024
1 parent 0491d23 commit d8d1409
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/cli/one_helper/oneflow_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ def self.conf_file
#
# @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
Expand Down
4 changes: 3 additions & 1 deletion src/cli/one_helper/oneflowtemplate_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ def self.conf_file
#
# @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
Expand Down
2 changes: 1 addition & 1 deletion src/oca/ruby/opennebula/oneflow_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def post(path, body)
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)
Expand Down

0 comments on commit d8d1409

Please sign in to comment.