Set defaults in ClientManager tests

SDK requires the default config values be present in the config
dict, add them in the tests that have unique ClientManager
creation.

Change-Id: I48dd3762377dd8b17ce039acba8c61116c798734
This commit is contained in:
Dean Troyer 2018-03-13 19:18:25 -05:00
parent 8f5edf0678
commit 22de9c2bbf
1 changed files with 20 additions and 14 deletions

View File

@ -25,9 +25,11 @@ from keystoneauth1 import token_endpoint
try:
from openstack.config import cloud_config
from openstack.config import defaults
_occ_in_sdk = True
except ImportError:
from os_client_config import cloud_config
from os_client_config import defaults
_occ_in_sdk = False
from openstack import connection
@ -312,16 +314,18 @@ class TestClientManager(utils.TestClientManager):
def test_client_manager_auth_setup_once(self, check_authn_options_func):
loader = loading.get_plugin_loader('password')
auth_plugin = loader.load_from_options(**AUTH_DICT)
cli_options = defaults.get_defaults()
cli_options.update({
'auth_type': 'password',
'auth': AUTH_DICT,
'interface': fakes.INTERFACE,
'region_name': fakes.REGION_NAME,
})
client_manager = self._clientmanager_class()(
cli_options=cloud_config.CloudConfig(
name='t1',
region='1',
config=dict(
auth_type='password',
auth=AUTH_DICT,
interface=fakes.INTERFACE,
region_name=fakes.REGION_NAME,
),
config=cli_options,
auth_plugin=auth_plugin,
),
api_version={
@ -357,18 +361,20 @@ class TestClientManager(utils.TestClientManager):
def test_client_manager_k2k_auth_setup(self):
loader = loading.get_plugin_loader('password')
auth_plugin = loader.load_from_options(**AUTH_DICT)
cli_options = defaults.get_defaults()
cli_options.update({
'auth_type': 'password',
'auth': AUTH_DICT,
'interface': fakes.INTERFACE,
'region_name': fakes.REGION_NAME,
'service_provider': fakes.SERVICE_PROVIDER_ID,
'remote_project_id': fakes.PROJECT_ID
})
client_manager = self._clientmanager_class()(
cli_options=cloud_config.CloudConfig(
name='t1',
region='1',
config=dict(
auth_type='password',
auth=AUTH_DICT,
interface=fakes.INTERFACE,
region_name=fakes.REGION_NAME,
service_provider=fakes.SERVICE_PROVIDER_ID,
remote_project_id=fakes.PROJECT_ID
),
config=cli_options,
auth_plugin=auth_plugin,
),
api_version={