Container Infrastructure Management Service for OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.7 KiB

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest import config
CONF = config.CONF
class Config(object):
"""Parses configuration to attributes required for auth and test data"""
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_tenant_name
def set_user_creds(cls, config):
# normal user creds
cls.user = CONF.identity.username
cls.passwd = CONF.identity.password
cls.tenant = CONF.identity.tenant_name
def set_auth_version(cls, config):
# auth version for client authentication
cls.auth_version = CONF.identity.auth_version
def set_auth_url(cls, config):
# auth_url for client authentication
if cls.auth_version == 'v3':
cls.auth_v3_url = CONF.identity.uri_v3
if 'uri' not in CONF.identity:
raise Exception('config missing auth_url key')
cls.auth_url = CONF.identity.uri
def set_region(cls, config):
if 'region' in CONF.identity:
cls.region = CONF.identity.region
cls.region = 'RegionOne'
def set_image_id(cls, config):
if 'image_id' not in CONF.magnum:
raise Exception('config missing image_id key')
cls.image_id = CONF.magnum.image_id
def set_nic_id(cls, config):
if 'nic_id' not in CONF.magnum:
raise Exception('config missing nic_id key')
cls.nic_id = CONF.magnum.nic_id
def set_keypair_id(cls, config):
if 'keypair_id' not in CONF.magnum:
raise Exception('config missing keypair_id key')
cls.keypair_id = CONF.magnum.keypair_id
def setUp(cls):