Browse Source

Merge "Reset *RemovalPoliciesMode for node delete" into stable/queens

changes/13/692113/1
Zuul 9 months ago
committed by Gerrit Code Review
parent
commit
a0498da856
2 changed files with 7 additions and 1 deletions
  1. +5
    -0
      tripleo_common/actions/scale.py
  2. +2
    -1
      tripleo_common/tests/actions/test_scale.py

+ 5
- 0
tripleo_common/actions/scale.py View File

@@ -113,6 +113,11 @@ class ScaleDownAction(templates.ProcessTemplatesAction):
'resource_list': [r.resource_name for r in role_resources]
}]

# force reset the removal_policies_mode to 'append'
# as 'update' can lead to deletion of unintended nodes.
removal_mode = "{0}RemovalPoliciesMode".format(role)
stack_params[removal_mode] = 'append'

return stack_params

def run(self, context):


+ 2
- 1
tripleo_common/tests/actions/test_scale.py View File

@@ -139,7 +139,8 @@ class ScaleDownActionTest(base.TestCase):
template={'heat_template_version': '2016-04-30'}
)

clear_list = list(['ComputeCount', 'ComputeRemovalPolicies'])
clear_list = list(['ComputeCount', 'ComputeRemovalPolicies',
'ComputeRemovalPoliciesMode'])
_, kwargs = heatclient.stacks.update.call_args
self.assertEqual(set(kwargs['clear_parameters']), set(clear_list))
self.assertEqual(kwargs['environment'], env)


Loading…
Cancel
Save