Merge "Make v3 update_user_password use **kwargs"
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 60abde7..e8d4a36 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -76,8 +76,8 @@
self.addCleanup(self.client.delete_user, user['id'])
# Update user with new password
new_password = data_utils.rand_name('pass1')
- self.client.update_user_password(user['id'], new_password,
- original_password)
+ self.client.update_user_password(user['id'], password=new_password,
+ original_password=original_password)
# TODO(lbragstad): Sleeping after the response status has been checked
# and the body loaded as JSON allows requests to fail-fast. The sleep
# is necessary because keystone will err on the side of security and
diff --git a/tempest/api/identity/v3/test_users.py b/tempest/api/identity/v3/test_users.py
index 2bab5d1..93814d3 100644
--- a/tempest/api/identity/v3/test_users.py
+++ b/tempest/api/identity/v3/test_users.py
@@ -50,13 +50,13 @@
# to change password back. important for allow_tenant_isolation = false
self.addCleanup(
self.non_admin_client_for_cleanup.update_user_password,
- user_id=user_id,
+ user_id,
password=old_pass,
original_password=new_pass)
# user updates own password
self.non_admin_client.update_user_password(
- user_id=user_id, password=new_pass, original_password=old_pass)
+ user_id, password=new_pass, original_password=old_pass)
# TODO(lbragstad): Sleeping after the response status has been checked
# and the body loaded as JSON allows requests to fail-fast. The sleep
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index bbd8804..f1d8a35 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -81,13 +81,13 @@
body = json.loads(body)
return service_client.ResponseBody(resp, body)
- def update_user_password(self, user_id, password, original_password):
- """Updates a user password."""
- update_user = {
- 'password': password,
- 'original_password': original_password
- }
- update_user = json.dumps({'user': update_user})
+ def update_user_password(self, user_id, **kwargs):
+ """Update a user password
+
+ Available params: see http://developer.openstack.org/
+ api-ref-identity-v3.html#changeUserPassword
+ """
+ update_user = json.dumps({'user': kwargs})
resp, _ = self.post('users/%s/password' % user_id, update_user)
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp)