Revision 239ed249

View differences:

src/cli/oneuser
120 120
        table=ShowTable.new(ShowTableUP)
121 121
        table.print_help
122 122
    end
123

  
123
    
124
    def special_options(opts, options)
125
        opts.on_tail("-n", "--no-hash", "Store plain password "<<
126
                "into the database") do |o|
127
            options[:no_hash]=true
128
        end
129
    end
124 130
end
125 131

  
126
oneup_opts=OneUPParse.new
132
oneup_opts=OneUPParse.new([:list])
127 133
oneup_opts.parse(ARGV)
128 134
ops=oneup_opts.options
129 135

  
......
136 142
    check_parameters("create", 2)
137 143
    user=OpenNebula::User.new(
138 144
        OpenNebula::User.build_xml, get_one_client)
139
    sha_password = Digest::SHA1.hexdigest(ARGV[1])
140
    result=user.allocate(ARGV[0],sha_password)
145
    if ops[:no_hash]
146
        sha_password = ARGV[1]
147
    else
148
        sha_password = Digest::SHA1.hexdigest(ARGV[1])
149
    end
150
    result=user.allocate(ARGV[0], sha_password)
141 151
    if !OpenNebula.is_error?(result)
142 152
        puts "ID: " + user.id.to_s if ops[:verbose]
143 153
        exit 0

Also available in: Unified diff