Revision f7d34f2d src/cli/oneuser

View differences:

src/cli/oneuser
33 33

  
34 34
require 'uri'
35 35

  
36
cmd=CommandParser::CmdParser.new(ARGV) do
36
NO_CLIENT_CMDS = [ :key, :"token-create", :login ]
37

  
38
cmd = CommandParser::CmdParser.new(ARGV) do
37 39
    usage "`oneuser` <command> [<args>] [<options>]"
38 40
    version OpenNebulaHelper::ONE_VERSION
39 41

  
40 42
    helper = OneUserHelper.new
41 43

  
42 44
    before_proc do
43
        helper.set_client(options) if ![:key].include?(@comm_name)
45
        if !NO_CLIENT_CMDS.include?(@comm_name)
46
            begin
47
                helper.set_client(options)
48
            rescue Exception => e
49
                STDERR.puts e.message
50

  
51
                if e.message != "ONE_AUTH file not present"
52
                    STDERR.puts e.backtrace
53
                end
54

  
55
                exit 1
56
            end
57
        end
44 58
    end
45 59

  
46 60
    ########################################################################

Also available in: Unified diff