From eb203157a8047d0fa40600ab7c1a577289909405 Mon Sep 17 00:00:00 2001 From: Alexander Tivelkov Date: Mon, 5 May 2014 18:08:15 +0400 Subject: [PATCH] Fixed a bug when the Heat template was not deleted on Env deletion API now passes an empty 'applications' list as part of environment instead of a Null-environment Also, the incomplete 'destroy' section of the Instance class has been removed This needs to be fixed later, however the current version is fine, as the stack will be properly deleted by the environment deploy code Change-Id: I176d5026ade2b0092381b0b2f9bb6273ec21abf7 Closes-bug: #1308910 --- meta/io.murano/Classes/resources/Instance.yaml | 10 ---------- muranoapi/db/services/environments.py | 4 +++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/meta/io.murano/Classes/resources/Instance.yaml b/meta/io.murano/Classes/resources/Instance.yaml index 66d401686..f88f0452f 100644 --- a/meta/io.murano/Classes/resources/Instance.yaml +++ b/meta/io.murano/Classes/resources/Instance.yaml @@ -88,16 +88,6 @@ Workflow: - $assignFip: false - $net.addHostToNetwork($, $assignFip) - destroy: - Body: - - $template: $.environment.stack.current() - - $patchBlock: - op: remove - path: format('/Resources/{0}', $.name) - - $template: patch($template, $patchBlock) - - $.environment.stack.setTemplate($template) - - $.environment.stack.push() - - $.environment.instanceNotifier.untrackApplication($this) prepareUserData: Body: diff --git a/muranoapi/db/services/environments.py b/muranoapi/db/services/environments.py index c4a4dd3ac..d2e81bf6b 100644 --- a/muranoapi/db/services/environments.py +++ b/muranoapi/db/services/environments.py @@ -130,7 +130,9 @@ class EnvironmentServices(object): #preparing data for removal from conductor env = environment.description - env['Objects'] = None + if 'Objects' in env and 'services' in env['Objects']: + env['Objects'].pop('services') + env['applications'] = [] data = { 'model': env,