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
This commit is contained in:
Daniel Clavijo Coca 2022-07-13 12:13:32 -05:00 committed by GitHub
parent 4729f8835b
commit acc1647bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,10 +234,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 = {}
@ -248,9 +245,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'])