1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B OpenNebula/one#5912: Fix CLI auth params (#2232)

being bypassed on oneflow-template

(cherry picked from commit acc1647bd226a963867482f35b2385b676de908b)
(cherry picked from commit 46fcb89634aa9ac88d24545c6777bc663611647b)
This commit is contained in:
Daniel Clavijo Coca 2022-07-13 12:13:32 -05:00 committed by Tino Vazquez
parent 46d6624599
commit 4d462de8da
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -202,10 +202,7 @@ CommandParser::CmdParser.new(ARGV) do
Instantiate a Service Template
EOT
command :instantiate,
instantiate_desc,
:templateid,
[:file, nil],
command :instantiate, instantiate_desc, :templateid, [:file, nil],
:options => [MULTIPLE, Service::JSON_FORMAT, Service::TOP] do
number = options[:multiple] || 1
params = {}
@ -216,9 +213,12 @@ CommandParser::CmdParser.new(ARGV) do
params['merge_template'] = JSON.parse(File.read(args[1])) if args[1]
unless params['merge_template']
service_template = OpenNebula::ServiceTemplate
.new_with_id(args[0],
OpenNebula::Client.new)
secret = "#{options[:username]}:#{options[:password]}"
one_client = OpenNebula::Client.new(secret)
service_template = OpenNebula::ServiceTemplate.new_with_id(
args[0], one_client
)
service_template.info
body = JSON.parse(service_template['/DOCUMENT/TEMPLATE/BODY'])