From cae55d8ac12ef29f648fd5a25d4244c0239cb29e Mon Sep 17 00:00:00 2001 From: Drago Rosson Date: Mon, 4 Jan 2016 10:32:08 -0600 Subject: [PATCH] Remove unconditional return of user_id This removes a legacy backwards compatibility codepath. Pre-Icehouse stacks that have resources which inherit from StackUser may require manual cleanup after deletion, as their stack user may not be deleted. This fixes issues with subusers using software config. Heat should not attempt to delete the stack user if one had not been created before. The code that this patch removes caused an ID to always be returned. Additionally, it set the ID in the resource metadata whether a stack user existed or not, making it impossible to tell if one existed only from data within the resource. Change-Id: I50804998fdce1f7de06906ae9a2f47317721a6f6 Closes-bug: #1531606 --- heat/engine/resources/stack_user.py | 9 --------- .../notes/legacy-stack-user-id-cebbad8b0f2ed490.yaml | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/legacy-stack-user-id-cebbad8b0f2ed490.yaml diff --git a/heat/engine/resources/stack_user.py b/heat/engine/resources/stack_user.py index e964bbce4..05c5d30f5 100644 --- a/heat/engine/resources/stack_user.py +++ b/heat/engine/resources/stack_user.py @@ -72,15 +72,6 @@ class StackUser(resource.Resource): user_id = self.data().get('user_id') if user_id: return user_id - else: - # FIXME(shardy): This is a legacy hack for backwards compatibility - # remove after an appropriate transitional period... - # Assume this is a resource that was created with - # a previous version of heat and that the resource_id - # is the user_id - if self.resource_id: - self.data_set('user_id', self.resource_id) - return self.resource_id def handle_delete(self): self._delete_user() diff --git a/releasenotes/notes/legacy-stack-user-id-cebbad8b0f2ed490.yaml b/releasenotes/notes/legacy-stack-user-id-cebbad8b0f2ed490.yaml new file mode 100644 index 000000000..f061952f7 --- /dev/null +++ b/releasenotes/notes/legacy-stack-user-id-cebbad8b0f2ed490.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - If upgrading with pre-icehouse stacks which contain resources that create + users (such as OS::Nova::Server, OS::Heat::SoftwareDeployment, and + OS::Heat::WaitConditionHandle), it is possible that the users will not be + removed upon stack deletion due to the removal of a legacy fallback code + path. In such a situation, these users will require manual removal.