B #5236: oneuser token-create does not work without ONE_AUTH

This commit is contained in:
Jaime Melis committed 2017-07-12 18:16:53 +02:00
1 parent 459265e1f0
commit f7d34f2dc7
2 files changed
+18 -4

No files matched your search

+16 -2
View File
@@ -33,14 +33,28 @@ require 'one_helper/onequota_helper'
require 'uri'
cmd=CommandParser::CmdParser.new(ARGV) do
NO_CLIENT_CMDS = [ :key, :"token-create", :login ]
cmd = CommandParser::CmdParser.new(ARGV) do
usage "`oneuser` <command> [<args>] [<options>]"
version OpenNebulaHelper::ONE_VERSION
helper = OneUserHelper.new
before_proc do
helper.set_client(options) if ![:key].include?(@comm_name)
if !NO_CLIENT_CMDS.include?(@comm_name)
begin
helper.set_client(options)
rescue Exception => e
STDERR.puts e.message
if e.message != "ONE_AUTH file not present"
STDERR.puts e.backtrace
end
exit 1
end
end
end
########################################################################