Merge "tempest: Allow the old-style name project name"

This commit is contained in:
Jenkins 2016-07-12 09:00:59 +00:00 committed by Gerrit Code Review
commit 30c0ec2b59

View File

@ -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):