diff --git a/magnum/tests/functional/common/config.py b/magnum/tests/functional/common/config.py index c5cc2cc854..646f5369fe 100644 --- a/magnum/tests/functional/common/config.py +++ b/magnum/tests/functional/common/config.py @@ -10,8 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +import warnings + from tempest import config +from oslo_config import cfg CONF = config.CONF @@ -24,7 +27,14 @@ class Config(object): def set_admin_creds(cls, config): cls.admin_user = CONF.auth.admin_username cls.admin_passwd = CONF.auth.admin_password - cls.admin_tenant = CONF.auth.admin_project_name + # NOTE(toabctl): also allow the old style tempest definition + try: + cls.admin_tenant = CONF.auth.admin_project_name + except cfg.NoSuchOptError: + cls.admin_tenant = CONF.auth.admin_tenant_name + warnings.warn("the config option 'admin_tenant_name' from the " + "'auth' section is deprecated. Please switch " + "to 'admin_project_name'.") @classmethod def set_user_creds(cls, config): @@ -36,7 +46,14 @@ class Config(object): # check Ia5132c5cb32355d6f26b8acdd92a0e55a2c19f41 cls.user = CONF.auth.admin_username cls.passwd = CONF.auth.admin_password - cls.tenant = CONF.auth.admin_project_name + # NOTE(toabctl): also allow the old style tempest definition + try: + cls.tenant = CONF.auth.admin_project_name + except cfg.NoSuchOptError: + cls.tenant = CONF.auth.admin_tenant_name + warnings.warn("the config option 'admin_tenant_name' from the " + "'auth' section is deprecated. Please switch " + "to 'admin_project_name'.") @classmethod def set_auth_version(cls, config):