From ad232f48845d84feb8d227246213d23851736d9c Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Fri, 11 Jul 2025 19:46:22 +0530 Subject: [PATCH] Add flavor to job yaml (at Job creation) Currently, when creating jobs, paddles does not get Job.flavor information. This leads to "flavor" getting set only after the job is completed. This commit adds "flavor" to job yaml config so Job.flavor is set when creating jobs. Signed-off-by: Vallari Agrawal --- teuthology/suite/run.py | 9 ++++++--- teuthology/suite/test/test_run_.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 347f6edb4a..984231dfb1 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -511,6 +511,12 @@ class Run(object): update_key('sha1', parsed_yaml, self.base_config) update_key('suite_sha1', parsed_yaml, self.base_config) + full_job_config = copy.deepcopy(self.base_config.to_dict()) + deep_merge(full_job_config, parsed_yaml) + flavor = util.get_install_task_flavor(full_job_config) + + parsed_yaml['flavor'] = flavor + arg = copy.deepcopy(self.base_args) arg.extend([ '--num', str(self.args.num), @@ -533,9 +539,6 @@ class Run(object): sha1 = self.base_config.sha1 if parsed_yaml.get('verify_ceph_hash', config.suite_verify_ceph_hash): - full_job_config = copy.deepcopy(self.base_config.to_dict()) - deep_merge(full_job_config, parsed_yaml) - flavor = util.get_install_task_flavor(full_job_config) version = util.package_version_for_hash(sha1, flavor, os_type, os_version, self.args.machine_type) if not version: diff --git a/teuthology/suite/test/test_run_.py b/teuthology/suite/test/test_run_.py index 3459e79ad8..a3e6d12b34 100644 --- a/teuthology/suite/test/test_run_.py +++ b/teuthology/suite/test/test_run_.py @@ -342,6 +342,7 @@ class TestScheduleSuite(object): 'timestamp', 'user', 'teuthology', + 'flavor', ] for t in teuthology_keys: y[t] = ANY -- 2.39.5