Fix hiera condition in UndercloudCtlplaneNetworkDeployment

_run_command() returns the output of the command executed.
If the Neutron API is disabled it would return the string
'false' which is in fact True as far as python is concerned.

We also need a depends_on to ensure the link to hiera.yaml
created in extraconfig/post_deploy/undercloud_post.sh is
already in place.

Change-Id: Iec958a92433d3f671862422ac85bc78d7babc01d
This commit is contained in:
Harald Jensås 2018-11-01 12:07:42 +01:00
parent 86e79e047e
commit f3e55fae5c
2 changed files with 6 additions and 2 deletions

View File

@ -260,8 +260,11 @@ def config_neutron_segments_and_subnets(sdk, ctlplane_id):
_ensure_neutron_router(sdk, name, subnet.id)
if _run_command(['hiera', 'neutron_api_enabled'], name='hiera'):
if 'true' not in _run_command(['hiera', 'neutron_api_enabled'],
name='hiera').lower():
print('WARNING: UndercloudCtlplaneNetworkDeployment : The Neutron API '
'is disabled. The ctlplane network cannot be configured.')
else:
sdk = os_client_config.make_sdk(auth_url=AUTH_URL,
project_name='admin',
username='admin',

View File

@ -145,6 +145,7 @@ resources:
UndercloudCtlplaneNetworkDeployment:
type: OS::Heat::SoftwareDeployments
depends_on: UndercloudPostDeployment
properties:
name: UndercloudCtlplaneNetworkDeployment
servers: {get_param: servers}