config-download remove role arg from _write_tasks_per_step()
This arg has never been used, let's just remove it. Change-Id: I2781cae14663094d531ad70c3d412b3153b46612
This commit is contained in:
parent
32c17e05d1
commit
d9811e94ea
|
@ -180,7 +180,7 @@ class TestConfig(base.TestCase):
|
||||||
% step)
|
% step)
|
||||||
playbook_tasks = self.config._write_tasks_per_step(
|
playbook_tasks = self.config._write_tasks_per_step(
|
||||||
self.config.stack_outputs.get('RoleData')[role]
|
self.config.stack_outputs.get('RoleData')[role]
|
||||||
['upgrade_tasks'], role, filepath, step)
|
['upgrade_tasks'], filepath, step)
|
||||||
self.assertTrue(os.path.isfile(filepath))
|
self.assertTrue(os.path.isfile(filepath))
|
||||||
self.assertEqual(expected_tasks[role][step], playbook_tasks)
|
self.assertEqual(expected_tasks[role][step], playbook_tasks)
|
||||||
|
|
||||||
|
@ -1076,7 +1076,6 @@ class OvercloudConfigTest(base.TestCase):
|
||||||
# Everything should come back
|
# Everything should come back
|
||||||
tasks_per_step = self.config._write_tasks_per_step(
|
tasks_per_step = self.config._write_tasks_per_step(
|
||||||
tasks,
|
tasks,
|
||||||
'Compute',
|
|
||||||
'Compute/update_tasks_step0.yaml',
|
'Compute/update_tasks_step0.yaml',
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
|
@ -1086,7 +1085,6 @@ class OvercloudConfigTest(base.TestCase):
|
||||||
# Using stict the tasks with no conditional will be dropped
|
# Using stict the tasks with no conditional will be dropped
|
||||||
tasks_per_step = self.config._write_tasks_per_step(
|
tasks_per_step = self.config._write_tasks_per_step(
|
||||||
tasks,
|
tasks,
|
||||||
'Compute',
|
|
||||||
'Compute/update_tasks_step0.yaml',
|
'Compute/update_tasks_step0.yaml',
|
||||||
0,
|
0,
|
||||||
strict=True,
|
strict=True,
|
||||||
|
@ -1100,7 +1098,6 @@ class OvercloudConfigTest(base.TestCase):
|
||||||
# Some tasks will be filtered out for step 3.
|
# Some tasks will be filtered out for step 3.
|
||||||
tasks_per_step = self.config._write_tasks_per_step(
|
tasks_per_step = self.config._write_tasks_per_step(
|
||||||
tasks,
|
tasks,
|
||||||
'Compute',
|
|
||||||
'Compute/update_tasks_step3.yaml',
|
'Compute/update_tasks_step3.yaml',
|
||||||
3
|
3
|
||||||
)
|
)
|
||||||
|
@ -1124,7 +1121,6 @@ class OvercloudConfigTest(base.TestCase):
|
||||||
# Even more tasks will be filtered out for step 3 with strict.
|
# Even more tasks will be filtered out for step 3 with strict.
|
||||||
tasks_per_step = self.config._write_tasks_per_step(
|
tasks_per_step = self.config._write_tasks_per_step(
|
||||||
tasks,
|
tasks,
|
||||||
'Compute',
|
|
||||||
'Compute/update_tasks_step3.yaml',
|
'Compute/update_tasks_step3.yaml',
|
||||||
3,
|
3,
|
||||||
strict=True,
|
strict=True,
|
||||||
|
|
|
@ -121,7 +121,7 @@ class Config(object):
|
||||||
return os.fdopen(
|
return os.fdopen(
|
||||||
os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600), 'w')
|
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):
|
def step_in_task(task, step, strict):
|
||||||
whenexpr = task.get('when', None)
|
whenexpr = task.get('when', None)
|
||||||
|
@ -279,9 +279,8 @@ class Config(object):
|
||||||
filepath = os.path.join(role_path, '%s_step%s.yaml'
|
filepath = os.path.join(role_path, '%s_step%s.yaml'
|
||||||
% (config, i))
|
% (config, i))
|
||||||
self._write_tasks_per_step(
|
self._write_tasks_per_step(
|
||||||
role[config], role_name,
|
role[config], filepath, i,
|
||||||
filepath,
|
constants.PER_STEP_TASKS[config][i])
|
||||||
i, constants.PER_STEP_TASKS[config][i])
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = role[config]
|
data = role[config]
|
||||||
|
|
Loading…
Reference in New Issue