Use tempest.conf when running under tempest

This change switches to a global config for heat_integrationtests, and
makes that global config the tempest config when running under
tempest.

After the transition to tempest init_conf won't be required at all.

blueprint tempest-plugin-support

Change-Id: Id22e7a03601db5adfc0b428004a75990278369a6
diff --git a/common/config.py b/common/config.py
index f4df28b..c2aac65 100644
--- a/common/config.py
+++ b/common/config.py
@@ -16,6 +16,8 @@
 
 import heat_integrationtests
 
+_CONF = None
+
 service_available_group = cfg.OptGroup(name="service_available",
                                        title="Available OpenStack Services")
 
@@ -162,6 +164,9 @@
 
 
 def init_conf(read_conf=True):
+    global _CONF
+    if _CONF:
+        return _CONF
 
     default_config_files = None
     if read_conf:
@@ -171,13 +176,13 @@
         if os.path.isfile(confpath):
             default_config_files = [confpath]
 
-    conf = cfg.ConfigOpts()
-    conf(args=[], project='heat_integrationtests',
-         default_config_files=default_config_files)
+    _CONF = cfg.ConfigOpts()
+    _CONF(args=[], project='heat_integrationtests',
+          default_config_files=default_config_files)
 
     for group, opts in list_opts():
-        conf.register_opts(opts, group=group)
-    return conf
+        _CONF.register_opts(opts, group=group)
+    return _CONF
 
 
 def list_opts():