Build a minimal bmc clouds.yaml

Currently every auth attribute (including every service endpoint
version) ends up in the generated BMC clouds.yaml, but most of these
values are not required and are discovered via the catalog.

This change builds a bare-minimal clouds.yaml.

Change-Id: Ic408cefa03f0c1ae7ba00fa891aa4bf3f81b3d1e
This commit is contained in:
Steve Baker 2022-05-05 14:45:54 +12:00
parent ae8499e00d
commit e7f4a60f4d
1 changed files with 7 additions and 2 deletions

View File

@ -64,5 +64,10 @@ def _cloud_json():
Retrieves the cloud from os-client-config and serializes it to JSON.
"""
config = os_client_config.OpenStackConfig().get_one_cloud(OS_CLOUD)
return json.dumps(config.config)
c = os_client_config.OpenStackConfig().get_one_cloud(OS_CLOUD)
minimal_config = {}
for k in ('auth', 'region_name', 'interface', 'identity_api_version'):
if k in c.config:
minimal_config[k] = c.config[k]
return json.dumps(minimal_config)