From 612a25371d16a0ae23308e25e54118a5ec6713d1 Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Tue, 5 Apr 2016 14:41:56 +0300 Subject: [PATCH] Heat stack deletion for HOT/TOSCA packages was fixed HeatStack class expects to be owned by some other and uses it to find OpenStack region name it belongs to. If there is no owner provided then the default region is used which is random for multi-region setups. MuranoPL code that was generated from HOT and TOSCA provided that owner on "deploy" phase but not on "destroy". So the stack that was successfully created earlier could never be deleted in multi-region OpenStack installations for non-default region. Change-Id: I19ca0c7129b073fdd852b22a6a7f84f7ee377ee7 Closes-Bug: #1565777 --- .../murano_heat-translator_plugin/plugin/csar_package.py | 5 ++++- murano/packages/hot_package.py | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/murano_heat-translator_plugin/plugin/csar_package.py b/contrib/plugins/murano_heat-translator_plugin/plugin/csar_package.py index 5ca54649..ff791dc1 100755 --- a/contrib/plugins/murano_heat-translator_plugin/plugin/csar_package.py +++ b/contrib/plugins/murano_heat-translator_plugin/plugin/csar_package.py @@ -355,8 +355,11 @@ class CSARPackage(package_base.PackageBase): ] destroy = [ + {YAQL('$environment'): YAQL( + "$.find('io.murano.Environment').require()" + )}, {YAQL('$stack'): YAQL( - "new('io.murano.system.HeatStack', " + "new('io.murano.system.HeatStack', $environment, " "name => $.getAttr(generatedHeatStackName))")}, YAQL('$stack.delete()') diff --git a/murano/packages/hot_package.py b/murano/packages/hot_package.py index f0ce0476..93830b7b 100644 --- a/murano/packages/hot_package.py +++ b/murano/packages/hot_package.py @@ -331,10 +331,12 @@ class HotPackage(package_base.PackageBase): ] destroy = [ + {YAQL('$environment'): YAQL( + "$.find('io.murano.Environment').require()" + )}, {YAQL('$stack'): YAQL( - "new('io.murano.system.HeatStack', " + "new('io.murano.system.HeatStack', $environment, " "name => $.getAttr(generatedHeatStackName))")}, - YAQL('$stack.delete()') ]