Ensure assigned-ips output is present in Heat template with Nova Network

When using Murano with Nova Network, the assigned-ips output is only added to
the template when a floating IP is assigned. This makes the deployment fail
when the engine tries to get the list of IPs of the created instance.

This patch makes sure that the hostname-assigned-ips output is added to the
template also when a floating IP is not assigned.

Change-Id: I8970a34e7c0b9fefdc236b046d6506f778143f3a
Closes-Bug: 1710623
(cherry picked from commit 3990acfcce)
This commit is contained in:
Victor Araujo 2017-08-14 15:39:18 +02:00 committed by Kirill Zaitsev
parent 07fd0b4667
commit 69581348f8
1 changed files with 8 additions and 5 deletions

View File

@ -38,11 +38,17 @@ Methods:
- $instanceResources: []
- $instanceOutputs: []
- $instanceNetworkOutput: format('{0}-assigned-ips', $instance.name)
- $template:
outputs:
$instanceNetworkOutput:
description: format('Network IPs assigned to {0} instance', $instance.name)
value:
get_attr: [ $instance.name, networks ]
- If: $assignFloatingIp
Then:
- $instanceFipOutput: $instance.name + '-floatingIPaddress'
- $fipName: format('fip-nn-{0}', $instance.name)
- $template:
- $fipTemplate:
resources:
$fipName:
type: 'OS::Nova::FloatingIP'
@ -58,10 +64,7 @@ Methods:
value:
get_attr: [$fipName, ip]
description: format('Floating IP of {0}', $instance.name)
$instanceNetworkOutput:
description: format('Network IPs assigned to {0} instance', $instance.name)
value:
get_attr: [ $instance.name, networks ]
- $template: $template.mergeWith($fipTemplate)
- $instanceResources: [$fipName, $fipName + 'Assignment']
- $instanceOutputs: [$instanceFipOutput, $instanceNetworkOutput]
- Return: