Prevent stale isolated tenants from blocking test runs

Especially while developing tests, it's easy to kill a test before
it has a chance to clean up the tenants it has created for isolation.
Since the database has a lot of consistency requirements, it's non-
trivial to go clean these up, and (for me) re-running stack.sh is
the quickest path to a running system again (which is annoying).

This patch adds a configuration option that can allow the tenant
creation to avoid the failure by re-using the existing tenant/user
already present. I think it's safe to have this enabled by default
since it only happens if tenant isolation is enabled.

Also, this augments the error message for the condition (in the case
that the configuration option is disabled) to better indicate
what is happening.

Change-Id: I97052b827ca1b2076ac67025539339b39d3260ae
diff --git a/tempest/services/identity/json/admin_client.py b/tempest/services/identity/json/admin_client.py
index 89a068e..cb9c10b 100644
--- a/tempest/services/identity/json/admin_client.py
+++ b/tempest/services/identity/json/admin_client.py
@@ -101,6 +101,13 @@
         body = json.loads(body)
         return resp, body['tenants']
 
+    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)
@@ -165,6 +172,13 @@
         body = json.loads(body)
         return resp, body['users']
 
+    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"""
         post_body = {