Fix for wrong onegroup behaviour

This commit is contained in:
Tino Vazquez committed 2014-01-10 17:25:55 +01:00
1 parent 5ca3a0f7d4
commit 972ba67a8a
1 file changed
+7 -2
+7 -2
View File
@@ -92,7 +92,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
EOT
command :create, create_desc, [:file, :group_name], :options =>
command :create, create_desc, [:file, :group_name, nil], :options =>
OpenNebulaHelper::GROUP_OPTIONS do
if args[0] && !options.empty?
@@ -101,6 +101,11 @@ cmd=CommandParser::CmdParser.new(ARGV) do
next -1
end
if !args[0] && options.empty?
STDERR.puts "Please use either a template, just a group name or command arguments"
next -1
end
if options && options[:admin_user]
if !options[:admin_passwd]
STDERR.puts "Admin user needs password"
@@ -116,7 +121,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
options[:user] = admin_user
end
if File.exists?(args[0])
if args[0] && File.exists?(args[0])
hashed_template = helper.parse_template(File.open(args[0]).read)
helper.create_complete_resource(hashed_template)
elsif !options.empty?