From d9811e94eaaaad9109caba79d5a2bc582c83cc6c Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 23 Jul 2020 14:23:15 -0400 Subject: [PATCH] config-download remove role arg from _write_tasks_per_step() This arg has never been used, let's just remove it. Change-Id: I2781cae14663094d531ad70c3d412b3153b46612 --- tripleo_common/tests/utils/test_config.py | 6 +----- tripleo_common/utils/config.py | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tripleo_common/tests/utils/test_config.py b/tripleo_common/tests/utils/test_config.py index 0bd0a975e..cce126e5c 100644 --- a/tripleo_common/tests/utils/test_config.py +++ b/tripleo_common/tests/utils/test_config.py @@ -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, diff --git a/tripleo_common/utils/config.py b/tripleo_common/utils/config.py index e455c67a2..d45b10e9f 100644 --- a/tripleo_common/utils/config.py +++ b/tripleo_common/utils/config.py @@ -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]