1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

B #1493: Options never will be empty when you create a resource

This commit is contained in:
juanmont 2017-11-21 11:02:48 +01:00 committed by Ruben S. Montero
parent ee6dab2d0c
commit 87a5fb45a4

View File

@ -87,13 +87,6 @@ cmd=CommandParser::CmdParser.new(ARGV) do
command :create, create_desc, [:group_name, nil], :options =>
OpenNebulaHelper::GROUP_OPTIONS do
if !args[0] && options.empty?
STDERR.puts "Please use either a group name or command arguments."<<
" Run onegroup create -h for more information"
next -1
end
if options && options[:admin_user]
if !options[:admin_password]
STDERR.puts "Admin user needs password"
@ -108,11 +101,15 @@ cmd=CommandParser::CmdParser.new(ARGV) do
options[:group_admin] = admin_user
end
if !options.empty?
helper.create_complete_resource(options)
elsif args[0]
if args[0]
options[:name] = args[0]
helper.create_complete_resource(options)
elsif options[:name]
helper.create_complete_resource(options)
else
STDERR.puts "Please use either a group name or command arguments."<<
" Run onegroup create -h for more information"
next -1
end
end