Remove legacy openstack settings from nodepool.yaml
Before os-client-config and shade, we would include cloud credentials in nodepool.yaml. But now comes the time where we can remove these settings in favor of using a local clouds.yaml file. Change-Id: Ie7af6dcd56dc48787f280816de939d07800e9d11 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
a953afd751
commit
f7289a5aca
@ -258,12 +258,6 @@ provider, the Nodepool image types are also defined (see
|
||||
- name: devstack-trusty
|
||||
min-ram: 30720
|
||||
- name: provider2
|
||||
username: 'username'
|
||||
password: 'password'
|
||||
auth-url: 'http://auth.provider2.example.com/'
|
||||
project-name: 'project'
|
||||
service-type: 'compute'
|
||||
service-name: 'compute'
|
||||
region-name: 'region1'
|
||||
max-servers: 96
|
||||
rate: 1.0
|
||||
@ -295,17 +289,6 @@ provider, the Nodepool image types are also defined (see
|
||||
portions of the cloud configuration directly in ``nodepool.yaml``. Not all
|
||||
of the options settable via ``clouds.yaml`` are available.
|
||||
|
||||
``username``
|
||||
|
||||
``password``
|
||||
|
||||
``project-id`` OR ``project-name``
|
||||
Some clouds may refer to the ``project-id`` as ``tenant-id``.
|
||||
Some clouds may refer to the ``project-name`` as ``tenant-name``.
|
||||
|
||||
``auth-url``
|
||||
Keystone URL.
|
||||
|
||||
``image-type``
|
||||
Specifies the image type supported by this provider. The disk images built
|
||||
by diskimage-builder will output an image for each ``image-type`` specified
|
||||
@ -370,12 +353,6 @@ provider, the Nodepool image types are also defined (see
|
||||
Timeout for the OpenStack API calls client in seconds. Prefer setting
|
||||
this in `clouds.yaml`
|
||||
|
||||
``service-type`` (compatability)
|
||||
Prefer setting this in `clouds.yaml`.
|
||||
|
||||
``service-name`` (compatability)
|
||||
Prefer setting this in `clouds.yaml`.
|
||||
|
||||
``region-name``
|
||||
|
||||
``hostname-format``
|
||||
|
@ -52,16 +52,9 @@ class ConfigValidator:
|
||||
providers = {
|
||||
'name': str,
|
||||
'region-name': str,
|
||||
'service-type': str,
|
||||
'service-name': str,
|
||||
'availability-zones': [str],
|
||||
'keypair': str,
|
||||
'cloud': str,
|
||||
'username': str,
|
||||
'password': str,
|
||||
'auth-url': str,
|
||||
'project-id': str,
|
||||
'project-name': str,
|
||||
'max-servers': int,
|
||||
'max-concurrency': int,
|
||||
'pool': str, # Ignored, but kept for backwards compat
|
||||
|
@ -276,25 +276,11 @@ def _cloudKwargsFromProvider(provider):
|
||||
if arg in provider:
|
||||
cloud_kwargs[arg] = provider[arg]
|
||||
|
||||
# These are named from back when we only talked to Nova. They're
|
||||
# actually compute service related
|
||||
if 'service-type' in provider:
|
||||
cloud_kwargs['compute-service-type'] = provider['service-type']
|
||||
if 'service-name' in provider:
|
||||
cloud_kwargs['compute-service-name'] = provider['service-name']
|
||||
|
||||
auth_kwargs = {}
|
||||
for auth_key in (
|
||||
'username', 'password', 'auth-url', 'project-id', 'project-name'):
|
||||
if auth_key in provider:
|
||||
auth_kwargs[auth_key] = provider[auth_key]
|
||||
|
||||
cloud_kwargs['auth'] = auth_kwargs
|
||||
return cloud_kwargs
|
||||
|
||||
|
||||
def _get_one_cloud(cloud_config, cloud_kwargs):
|
||||
'''This is a function to allow for overriding it in tests.'''
|
||||
if cloud_kwargs.get('auth', {}).get('auth-url', '') == 'fake':
|
||||
if cloud_kwargs.get('cloud') == 'fake':
|
||||
return fakeprovider.fake_get_one_cloud(cloud_config, cloud_kwargs)
|
||||
return cloud_config.get_one_cloud(**cloud_kwargs)
|
||||
|
@ -45,7 +45,7 @@ class NotFound(Exception):
|
||||
|
||||
|
||||
def get_provider_manager(provider, use_taskmanager):
|
||||
if (provider.cloud_config.get_auth_args().get('auth_url') == 'fake'):
|
||||
if (provider.cloud_config.name == 'fake'):
|
||||
return FakeProviderManager(provider, use_taskmanager)
|
||||
else:
|
||||
return ProviderManager(provider, use_taskmanager)
|
||||
|
@ -153,6 +153,10 @@ class BaseTestCase(testtools.TestCase):
|
||||
self.useFixture(fixtures.MonkeyPatch(
|
||||
'nodepool.nodepool._get_one_cloud',
|
||||
fakeprovider.fake_get_one_cloud))
|
||||
clouds_path = os.path.join(os.path.dirname(__file__),
|
||||
'fixtures', 'clouds.yaml')
|
||||
self.useFixture(fixtures.MonkeyPatch(
|
||||
'os_client_config.config.CONFIG_FILES', [clouds_path]))
|
||||
|
||||
def wait_for_threads(self):
|
||||
# Wait until all transient threads (node launches, deletions,
|
||||
|
7
nodepool/tests/fixtures/clouds.yaml
vendored
Normal file
7
nodepool/tests/fixtures/clouds.yaml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
clouds:
|
||||
fake:
|
||||
auth:
|
||||
usernmae: 'fake'
|
||||
password: 'fake'
|
||||
project_id: 'fake'
|
||||
auth_url: 'fake'
|
@ -27,12 +27,6 @@ labels:
|
||||
providers:
|
||||
- name: cloud1
|
||||
region-name: 'vanilla'
|
||||
service-type: 'compute'
|
||||
service-name: 'cloudServersOpenStack'
|
||||
username: '<%= username %>'
|
||||
password: '<%= password %>'
|
||||
project-id: '<%= project %>'
|
||||
auth-url: 'https://identity.example.com/v2.0/'
|
||||
boot-timeout: 120
|
||||
max-servers: 184
|
||||
max-concurrency: 10
|
||||
@ -43,12 +37,6 @@ providers:
|
||||
min-ram: 8192
|
||||
- name: cloud2
|
||||
region-name: 'chocolate'
|
||||
service-type: 'compute'
|
||||
service-name: 'cloudServersOpenStack'
|
||||
username: '<%= username %>'
|
||||
password: '<%= password %>'
|
||||
project-id: '<%= project %>'
|
||||
auth-url: 'https://identity.example.com/v2.0/'
|
||||
boot-timeout: 120
|
||||
max-servers: 184
|
||||
rate: 0.001
|
||||
|
@ -27,12 +27,6 @@ labels:
|
||||
providers:
|
||||
- name: cloud1
|
||||
region-name: 'vanilla'
|
||||
service-type: 'compute'
|
||||
service-name: 'cloudServersOpenStack'
|
||||
username: '<%= username %>'
|
||||
password: '<%= password %>'
|
||||
project-id: '<%= project %>'
|
||||
auth-url: 'https://identity.example.com/v2.0/'
|
||||
boot-timeout: 120
|
||||
max-servers: 184
|
||||
rate: 0.001
|
||||
@ -41,12 +35,6 @@ providers:
|
||||
min-ram: 8192
|
||||
- name: cloud2
|
||||
region-name: 'chocolate'
|
||||
service-type: 'compute'
|
||||
service-name: 'cloudServersOpenStack'
|
||||
username: '<%= username %>'
|
||||
password: '<%= password %>'
|
||||
project-id: '<%= project %>'
|
||||
auth-url: 'https://identity.example.com/v2.0/'
|
||||
boot-timeout: 120
|
||||
max-servers: 184
|
||||
rate: 0.001
|
||||
|
4
nodepool/tests/fixtures/integration.yaml
vendored
4
nodepool/tests/fixtures/integration.yaml
vendored
@ -18,10 +18,6 @@ providers:
|
||||
- name: real-provider
|
||||
region-name: real-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'real'
|
||||
password: 'real'
|
||||
auth-url: 'real'
|
||||
project-id: 'real'
|
||||
max-servers: 96
|
||||
pool: 'real'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/leaked_node.yaml
vendored
4
nodepool/tests/fixtures/leaked_node.yaml
vendored
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
5
nodepool/tests/fixtures/node.yaml
vendored
5
nodepool/tests/fixtures/node.yaml
vendored
@ -19,14 +19,11 @@ labels:
|
||||
|
||||
providers:
|
||||
- name: fake-provider
|
||||
cloud: fake
|
||||
region-name: fake-region
|
||||
availability-zones:
|
||||
- az1
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/node_az.yaml
vendored
4
nodepool/tests/fixtures/node_az.yaml
vendored
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
8
nodepool/tests/fixtures/node_cmd.yaml
vendored
8
nodepool/tests/fixtures/node_cmd.yaml
vendored
@ -24,10 +24,6 @@ labels:
|
||||
providers:
|
||||
- name: fake-provider1
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -42,10 +38,6 @@ providers:
|
||||
key2: value
|
||||
- name: fake-provider2
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -26,10 +26,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -26,10 +26,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
12
nodepool/tests/fixtures/node_ipv6.yaml
vendored
12
nodepool/tests/fixtures/node_ipv6.yaml
vendored
@ -33,10 +33,6 @@ providers:
|
||||
- name: fake-provider1
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -54,10 +50,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -74,10 +66,6 @@ providers:
|
||||
- name: fake-provider3
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -40,10 +36,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -19,12 +19,9 @@ labels:
|
||||
|
||||
providers:
|
||||
- name: fake-provider
|
||||
cloud: 'fake'
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
launch-retries: 2
|
||||
|
@ -23,10 +23,6 @@ providers:
|
||||
availability-zones:
|
||||
- az1
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/node_net_name.yaml
vendored
4
nodepool/tests/fixtures/node_net_name.yaml
vendored
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/node_quota.yaml
vendored
4
nodepool/tests/fixtures/node_quota.yaml
vendored
@ -23,10 +23,6 @@ providers:
|
||||
availability-zones:
|
||||
- az1
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 2
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/node_two_image.yaml
vendored
4
nodepool/tests/fixtures/node_two_image.yaml
vendored
@ -26,10 +26,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -22,10 +22,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -41,10 +37,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -40,10 +36,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
@ -22,10 +22,6 @@ providers:
|
||||
- name: fake-provider1
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 2
|
||||
pool: 'fake'
|
||||
networks:
|
||||
@ -42,10 +38,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 2
|
||||
pool: 'fake'
|
||||
networks:
|
||||
|
4
nodepool/tests/fixtures/node_vhd.yaml
vendored
4
nodepool/tests/fixtures/node_vhd.yaml
vendored
@ -21,10 +21,6 @@ providers:
|
||||
- name: fake-provider
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
pool: 'fake'
|
||||
image-type: vhd
|
||||
|
@ -22,10 +22,6 @@ providers:
|
||||
- name: fake-provider1
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 2
|
||||
pool: 'fake'
|
||||
image-type: vhd
|
||||
@ -42,10 +38,6 @@ providers:
|
||||
- name: fake-provider2
|
||||
region-name: fake-region
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 2
|
||||
pool: 'fake'
|
||||
image-type: qcow2
|
||||
|
@ -50,11 +50,6 @@ class TestShadeIntegration(tests.IntegrationTestCase):
|
||||
pm = provider_manager.ProviderManager(
|
||||
config.providers['real-provider'], use_taskmanager=False)
|
||||
pm.start()
|
||||
auth_data = {'username': 'real',
|
||||
'project_id': 'real',
|
||||
'password': 'real',
|
||||
'auth_url': 'real'}
|
||||
self.assertEqual(pm._client.auth, auth_data)
|
||||
self.assertEqual(pm._client.region_name, 'real-region')
|
||||
|
||||
def test_nodepool_occ_config(self):
|
||||
|
@ -27,10 +27,6 @@ providers:
|
||||
- name: fake-provider
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
region-name: 'fake-region'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
images:
|
||||
- name: fake-dib-image
|
||||
|
@ -35,10 +35,6 @@ providers:
|
||||
- name: fake-provider
|
||||
keypair: 'if-present-use-this-keypair'
|
||||
region-name: 'fake-region'
|
||||
username: 'fake'
|
||||
password: 'fake'
|
||||
auth-url: 'fake'
|
||||
project-id: 'fake'
|
||||
max-servers: 96
|
||||
images:
|
||||
- name: fake-nodepool
|
||||
|
7
tools/zuul-nodepool-integration/clouds.yaml
Normal file
7
tools/zuul-nodepool-integration/clouds.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
clouds:
|
||||
fake:
|
||||
auth:
|
||||
usernmae: 'fake'
|
||||
password: 'fake'
|
||||
project_id: 'fake'
|
||||
auth_url: 'fake'
|
@ -24,8 +24,8 @@ labels:
|
||||
|
||||
providers:
|
||||
- name: fake-provider
|
||||
cloud: fake
|
||||
max-servers: 96
|
||||
auth-url: 'fake'
|
||||
images:
|
||||
- name: fake-nodepool
|
||||
min-ram: 8192
|
||||
|
@ -5,5 +5,7 @@ cd "$(dirname "$0")"
|
||||
mkdir -p /tmp/nodepool/images
|
||||
mkdir -p /tmp/nodepool/log
|
||||
|
||||
export OS_CLIENT_CONFIG_FILE=`pwd`/clouds.yaml
|
||||
|
||||
nodepool-builder -c `pwd`/nodepool.yaml -l `pwd`/builder-logging.conf -p /tmp/nodepool/builder.pid --fake
|
||||
nodepoold -c `pwd`/nodepool.yaml -s `pwd`/secure.conf -l `pwd`/launcher-logging.conf -p /tmp/nodepool/launcher.pid
|
||||
|
Loading…
Reference in New Issue
Block a user