[Core-Library] Reset all out properties during releasing

Closes-Bug: #1514779
Change-Id: Ibeae1cda1b62de0d330832cf89f670d5224180c9
This commit is contained in:
Dmytro Dovbii 2016-02-08 10:21:49 +02:00
parent c5725038d3
commit c6b9e580a6
4 changed files with 40 additions and 8 deletions

View File

@ -26,13 +26,14 @@ Properties:
Contract: $.string() Contract: $.string()
Usage: Out Usage: Out
Workflow: Methods:
initialize: initialize:
Body: Body:
- $.environment: $.find(Environment).require() - $.environment: $.find(Environment).require()
- $.network: $.environment.defaultNetworks.environment - $.network: $.environment.defaultNetworks.environment
- $.instances: [] - $.instances: []
deploy: deploy:
Body: Body:
- If: not $.getAttr(deployed, false) - If: not $.getAttr(deployed, false)
@ -59,20 +60,20 @@ Workflow:
- If: $.assignFloatingIp - If: $.assignFloatingIp
Then: Then:
- $extNetId: $networkData.floatingIpNetId - $extNetId: $networkData.floatingIpNetId
- $fip_name: format('Shared-Floating-ip-{0}', $.id()) - $fipName: format('Shared-Floating-ip-{0}', $.id())
- $template: - $template:
resources: resources:
$fip_name: $fipName:
type: 'OS::Neutron::FloatingIP' type: 'OS::Neutron::FloatingIP'
properties: properties:
floating_network_id: $extNetId floating_network_id: $extNetId
port_id: port_id:
get_resource: $aapPortName get_resource: $aapPortName
outputs: outputs:
$fip_name + '-val': $fipName + '-val':
value: value:
get_attr: [$fip_name, floating_ip_address] get_attr: [$fipName, floating_ip_address]
description: Shared Floating IP assigned description: Shared Floating IP assigned
- $.environment.stack.updateTemplate($template) - $.environment.stack.updateTemplate($template)
@ -95,6 +96,16 @@ Workflow:
get_attr: [$aapPortName, fixed_ips, 0, ip_address] get_attr: [$aapPortName, fixed_ips, 0, ip_address]
releaseResources:
Body:
- $template: $.environment.stack.current()
- $template.resources: $template.resources.delete(format('AllowedAddressPairsPort-{0}', id($)))
- $template.outputs: $template.outputs.delete(format('AllowedAddressPairsPort-{0}-virtualIp', id($)))
- If: $.assignFloatingIp
Then:
- $template.resources: $template.resources.delete(format('Shared-Floating-ip-{0}', id($)))
- $template.outputs: $template.outputs.delete(format('Shared-Floating-ip-{0}-val', id($)))
- $._environment.stack.setTemplate($template)
- $._environment.stack.push()
- $.floatingIpAddress: null
- $.virtualIp: null

View File

@ -129,6 +129,7 @@ Methods:
- $._environment.stack.setTemplate($template) - $._environment.stack.setTemplate($template)
- $._environment.stack.push() - $._environment.stack.push()
- $.setAttr(lastTemplate, null) - $.setAttr(lastTemplate, null)
- $.openstackId: null
getRef: getRef:
Body: Body:

View File

@ -270,6 +270,9 @@ Methods:
- $.setAttr(instanceResources, []) - $.setAttr(instanceResources, [])
- $.setAttr(instanceOutputs, []) - $.setAttr(instanceOutputs, [])
- $.setAttr(fipAssigned, false) - $.setAttr(fipAssigned, false)
- $.openstackId: null
- $.ipAddresses: []
- $.floatingIpAddress: null
destroy: destroy:
Body: Body:

View File

@ -184,6 +184,23 @@ Methods:
gateway: $subnet.gateway_ip gateway: $subnet.gateway_ip
floatingIpNetId: $._getExternalNetId() floatingIpNetId: $._getExternalNetId()
releaseResources:
Body:
- $template: $.environment.stack.current()
- $template.resources: $template.resources.delete(format('{0}-{1}', $.name, $.id()))
- $template.resources: $template.resources.delete($._getSubnetName())
- $template.outputs: $template.outputs.delete(format('{0}-id', $.name))
- If: $.externalRouterId != null
Then:
$template.resources: $template.resources.delete($._getRouterInterfaceName())
- $._environment.stack.setTemplate($template)
- $._environment.stack.push()
- $.openstackId: null
_getRouterInterfaceName: _getRouterInterfaceName:
Body: Body: