Revision fa96d8a7 src/cli/oneuser

View differences:

src/cli/oneuser
103 103
* list (Lists all the users in the pool)
104 104
    oneuser list
105 105

  
106
* passwd (Changes the given user's password)
107
    oneuser passwd <id> password
108

  
106 109
EOT
107 110

  
108 111
    def text_commands
......
181 184
            puts "User deleted" if ops[:verbose]
182 185
        end
183 186
    end
184
    
187

  
188
when "passwd"
189
    check_parameters("passwd", 2)
190

  
191
    user_id=get_user_id(ARGV[0])
192

  
193
    user=OpenNebula::User.new_with_id(user_id, get_one_client)
194

  
195
    sha_password = Digest::SHA1.hexdigest(ARGV[1])
196
    result=user.passwd(sha_password)
197

  
198
    if !OpenNebula.is_error?(result)
199
        puts "Password changed" if ops[:verbose]
200
    else
201
        puts
202
    end
203

  
185 204
when "list"
186 205
    if !ops[:xml]
187 206
        uplist=UPShow.new

Also available in: Unified diff