Add missing methods to xml admin_client.
This adds methods missing from the xml version of the identity
admin client. These methods are needed by some of the tests in
test_list_server_filters.
Partially fixes bug 1059568
Change-Id: Iec0fd7ff49de78b9681ccfa27963393aff248b5f
diff --git a/tempest/services/identity/xml/admin_client.py b/tempest/services/identity/xml/admin_client.py
index 8448ae0..60897e9 100644
--- a/tempest/services/identity/xml/admin_client.py
+++ b/tempest/services/identity/xml/admin_client.py
@@ -136,6 +136,13 @@
body = self._parse_array(etree.fromstring(body))
return resp, body
+ def get_tenant_by_name(self, tenant_name):
+ resp, tenants = self.list_tenants()
+ for tenant in tenants:
+ if tenant['name'] == tenant_name:
+ return tenant
+ raise exceptions.NotFound('No such tenant')
+
def update_tenant(self, tenant_id, **kwargs):
"""Updates a tenant."""
resp, body = self.get_tenant(tenant_id)
@@ -198,6 +205,13 @@
body = self._parse_array(etree.fromstring(body))
return resp, body
+ def get_user_by_username(self, tenant_id, username):
+ resp, users = self.list_users_for_tenant(tenant_id)
+ for user in users:
+ if user['name'] == username:
+ return user
+ raise exceptions.NotFound('No such user')
+
def create_service(self, name, type, **kwargs):
"""Create a service."""
OS_KSADM = "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"