Convert image and identity api tests to use global CONF object

This commit takes all the uses of config in the image and identity api
tests and converts them to use the global CONF object.

Partially implements bp config-cleanup

Change-Id: Ic305ce82d2bd5d0ef8293fe25c6a4c835633b0e8
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 0bded78..1bebad4 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -31,7 +31,7 @@
         if not CONF.identity_feature_enabled.trust:
             raise self.skipException("Trusts aren't enabled")
 
-        self.trustee_username = self.config.identity.alt_username
+        self.trustee_username = CONF.identity.alt_username
         self.trust_id = None
 
     def tearDown(self):
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 2e69579..37b848c 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -17,10 +17,13 @@
 from tempest import clients
 from tempest.common import isolated_creds
 from tempest.common.utils import data_utils
+from tempest import config
 from tempest import exceptions
 from tempest.openstack.common import log as logging
 import tempest.test
 
+CONF = config.CONF
+
 LOG = logging.getLogger(__name__)
 
 
@@ -35,10 +38,10 @@
         cls._interface = 'json'
         cls.isolated_creds = isolated_creds.IsolatedCreds(
             cls.__name__, network_resources=cls.network_resources)
-        if not cls.config.service_available.glance:
+        if not CONF.service_available.glance:
             skip_msg = ("%s skipped as glance is not available" % cls.__name__)
             raise cls.skipException(skip_msg)
-        if cls.config.compute.allow_tenant_isolation:
+        if CONF.compute.allow_tenant_isolation:
             creds = cls.isolated_creds.get_primary_creds()
             username, tenant_name, password = creds
             cls.os = clients.Manager(username=username,
@@ -83,7 +86,7 @@
     def setUpClass(cls):
         super(BaseV1ImageTest, cls).setUpClass()
         cls.client = cls.os.image_client
-        if not cls.config.image_feature_enabled.api_v1:
+        if not CONF.image_feature_enabled.api_v1:
             msg = "Glance API v1 not supported"
             raise cls.skipException(msg)
 
@@ -92,7 +95,7 @@
     @classmethod
     def setUpClass(cls):
         super(BaseV1ImageMembersTest, cls).setUpClass()
-        if cls.config.compute.allow_tenant_isolation:
+        if CONF.compute.allow_tenant_isolation:
             creds = cls.isolated_creds.get_alt_creds()
             username, tenant_name, password = creds
             cls.os_alt = clients.Manager(username=username,
@@ -124,7 +127,7 @@
     def setUpClass(cls):
         super(BaseV2ImageTest, cls).setUpClass()
         cls.client = cls.os.image_client_v2
-        if not cls.config.image_feature_enabled.api_v2:
+        if not CONF.image_feature_enabled.api_v2:
             msg = "Glance API v2 not supported"
             raise cls.skipException(msg)
 
@@ -134,7 +137,7 @@
     @classmethod
     def setUpClass(cls):
         super(BaseV2MemberImageTest, cls).setUpClass()
-        if cls.config.compute.allow_tenant_isolation:
+        if CONF.compute.allow_tenant_isolation:
             creds = cls.isolated_creds.get_alt_creds()
             username, tenant_name, password = creds
             cls.os_alt = clients.Manager(username=username,