Merge "config-download remove role arg from _write_tasks_per_step()"

This commit is contained in:
Zuul 2020-07-24 04:06:12 +00:00 committed by Gerrit Code Review
commit 09d207498a
2 changed files with 4 additions and 9 deletions

View File

@ -180,7 +180,7 @@ class TestConfig(base.TestCase):
% step)
playbook_tasks = self.config._write_tasks_per_step(
self.config.stack_outputs.get('RoleData')[role]
['upgrade_tasks'], role, filepath, step)
['upgrade_tasks'], filepath, step)
self.assertTrue(os.path.isfile(filepath))
self.assertEqual(expected_tasks[role][step], playbook_tasks)
@ -1076,7 +1076,6 @@ class OvercloudConfigTest(base.TestCase):
# Everything should come back
tasks_per_step = self.config._write_tasks_per_step(
tasks,
'Compute',
'Compute/update_tasks_step0.yaml',
0
)
@ -1086,7 +1085,6 @@ class OvercloudConfigTest(base.TestCase):
# Using stict the tasks with no conditional will be dropped
tasks_per_step = self.config._write_tasks_per_step(
tasks,
'Compute',
'Compute/update_tasks_step0.yaml',
0,
strict=True,
@ -1100,7 +1098,6 @@ class OvercloudConfigTest(base.TestCase):
# Some tasks will be filtered out for step 3.
tasks_per_step = self.config._write_tasks_per_step(
tasks,
'Compute',
'Compute/update_tasks_step3.yaml',
3
)
@ -1124,7 +1121,6 @@ class OvercloudConfigTest(base.TestCase):
# Even more tasks will be filtered out for step 3 with strict.
tasks_per_step = self.config._write_tasks_per_step(
tasks,
'Compute',
'Compute/update_tasks_step3.yaml',
3,
strict=True,

View File

@ -121,7 +121,7 @@ class Config(object):
return os.fdopen(
os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w')
def _write_tasks_per_step(self, tasks, role, filepath, step, strict=False):
def _write_tasks_per_step(self, tasks, filepath, step, strict=False):
def step_in_task(task, step, strict):
whenexpr = task.get('when', None)
@ -279,9 +279,8 @@ class Config(object):
filepath = os.path.join(role_path, '%s_step%s.yaml'
% (config, i))
self._write_tasks_per_step(
role[config], role_name,
filepath,
i, constants.PER_STEP_TASKS[config][i])
role[config], filepath, i,
constants.PER_STEP_TASKS[config][i])
try:
data = role[config]