Skip to content

Commit

Permalink
B #3572: Change in onegate client to ensure compatibility with old se…
Browse files Browse the repository at this point in the history
…rvers (#3643)
  • Loading branch information
Alejandro Huertas Herrero authored and Ruben S. Montero committed Sep 6, 2019
1 parent 8196694 commit 4ccf7f0
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions share/onegate/onegate
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ OptionParser.new do |opts|
end

opts.on("-e", "--erase DATA", "Data to be removed from the VM") do |data|
options[:erase] = data
options[:data] = data
options[:type] = 2
end

opts.on("-r", "--role ROLE", "Service role") do |role|
Expand Down Expand Up @@ -578,18 +579,12 @@ when "vm"
exit -1
end

data = {}

if options[:data]
data[:data] = options[:data]
data[:type] = 1
if options[:type]
data = URI.encode_www_form(options)
else
data[:data] = options[:erase]
data[:type] = 2
data = options[:data]
end

data = URI.encode_www_form(data)

if ARGV[2]
response = client.put("/vms/" + ARGV[2], data)
else
Expand Down

0 comments on commit 4ccf7f0

Please sign in to comment.