Merge "Remove partial clean-up in Instance.destroy"

This commit is contained in:
Jenkins 2014-09-05 12:38:37 +00:00 committed by Gerrit Code Review
commit 8e913882cd
6 changed files with 14 additions and 21 deletions

View File

@ -240,28 +240,15 @@ Methods:
- $.setAttr(fipAssigned, true)
destroy:
# Fixme(smelikyan): We need to remove all associated resources on destroy
# FIXME(smelikyan): All allocated resources should be cleaned-up on destroy
# Now no clean-up happens here cause we don't track all native resources
# that are allocated at the moment in descendants of Instance or other
# classes that may allocate resource dependent on OS::Nova:Server used
# as underlying implementation for Instance. This can cause
# resource leak when environment is updated. Resources are cleaned-up only
# when whole Environment is deleted (alongside with Heat stack deletion).
# https://bugs.launchpad.net/murano/+bug/1359998
Body:
- $template: $.environment.stack.current()
# Remove OS::Nova::Server resource
- $patchBlock:
op: remove
path: format('/resources/{0}', $.name)
- $template: patch($template, $patchBlock)
# Remove Ip Addresses Outputs assigned to this Instance
- $assignedIpBlock:
op: remove
path: format('/outputs/{0}-assigned-ip', $.name)
- $template: patch($template, $assignedIpBlock)
# Remove Floatting IP Addresses Outputs
- If: $.getAttr(fipAssigned, false)
Then:
- $assignedFloatingIpBlock:
op: remove
path: format('/outputs/{0}-FloatingIPaddress', $.name)
- $template: patch($template, $assignedFloatingIpBlock)
- $.environment.stack.setTemplate($template)
- $.environment.stack.push()
- $.environment.instanceNotifier.untrackCloudInstance($this)
createDefaultInstanceSecurityGroupRules:

View File

@ -402,6 +402,9 @@ class MuranoBase(testtools.TestCase, testtools.testcase.WithAttributes,
return stack
def test_instance_refs_are_removed_after_application_is_removed(self):
# FIXME(sergmelikyan): Revise this as part of proper fix for #1359998
self.skipTest('Skipped until proper fix for #1359998 is proposed')
name = 'e' + uuid.uuid4().hex
# create environment with telnet application

View File

@ -40,6 +40,9 @@ TEMPLATE = {
class TestDestroy(test_case.DslTestCase):
def test_destroy_removes_ip_address_from_outputs(self):
# FIXME(sergmelikyan): Revise this as part of proper fix for #1359998
self.skipTest('skipped until proper fix for #1359998 is proposed')
heat_stack_obj = om.Object('io.murano.system.HeatStack')
instance_obj = om.Object(
'io.murano.resources.Instance',