How can I change the user's password in openstacksdk?

asked 2017-10-09 03:44:14 -0500

liaodalin19903 gravatar image

I check openstack-sdk source code, I want to change the user's password, and I saw this code in openstack/identity/v3/_proxy: (line656)

def update_user(self, user, **attrs):
    """Update a user

    :param user: Either the ID of a user or a
                 :class:`~openstack.identity.v3.user.User` instance.
    :attrs kwargs: The attributes to update on the user represented
                   by ``value``.

    :returns: The updated user
    :rtype: :class:`~openstack.identity.v3.user.User`
    return self._update(_user.User, user, **attrs)

So, in my project I change the password, use this code: conn.identity.update_user({"password":new_password}) # attention, if I give the user_id to it, it will report error, says: requires 2 args, but 3 given.

Use my code. it do not report error, but seems it did not change the password, because I use the new password to login, it will login fail, and I also tried use the dashboard, can not login too. So, how can I change the password correctly?

Thanks for your time in the midst of pressing affairs.

edit retag flag offensive close merge delete