From b1ef0e785249e5e360021972530511dad7b6a9a1 Mon Sep 17 00:00:00 2001 From: Mathieu Bultel Date: Thu, 23 Nov 2017 21:32:45 +0100 Subject: [PATCH] Add exclude list to not override user data Add an exclude list of file which can possibly contains user data. When those files are modified by the user, we should not erased those when we update the plan during the upgrade Change-Id: I4e53d8f95170c25b32a6d714a7620c2c9d2596f3 Closes-Bug: #1734108 (cherry picked from commit 3a9337bb60168fcd328a3f63ee704e8e4d5a05f6) --- tripleo_common/actions/plan.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tripleo_common/actions/plan.py b/tripleo_common/actions/plan.py index bfb31569e..55f848dcf 100644 --- a/tripleo_common/actions/plan.py +++ b/tripleo_common/actions/plan.py @@ -279,6 +279,10 @@ class UpdatePlanFromDirAction(base.TripleOAction): '')[1].splitlines() old_templates = swift.get_object(self.container, '')[1].splitlines() + exclude_user_data = [constants.PLAN_ENVIRONMENT, + constants.OVERCLOUD_J2_ROLES_NAME, + constants.OVERCLOUD_J2_NETWORKS_NAME, + constants.OVERCLOUD_J2_EXCLUDES] # Update the old container for new in new_templates: # if doesn't exist, push it: @@ -291,7 +295,7 @@ class UpdatePlanFromDirAction(base.TripleOAction): content_new = swift.get_object(container_tmp, new) content_old = swift.get_object(self.container, new) if (not content_new == content_old and - constants.PLAN_ENVIRONMENT not in new): + new not in exclude_user_data): swift.put_object( self.container, new,