From 28c06872f86a6d432e89ab4923bb807145e3aefc Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Tue, 10 Aug 2021 14:50:42 -0700 Subject: [PATCH] Fix: Use cloud agent name as default node label Rather than quitting if there are no labels defined, we can instead use the agent name (e.g. "centos7-2c-1g") as the default label. This recreates the functionality of the groovy scripts previously used. Issue: RELENG-3863 Change-Id: I3817cca81358fa151fdeb1bbc8516df983327965 Signed-off-by: Eric Ball --- jenkins-admin/create_jenkins_clouds_openstack_yaml.py | 5 ++--- releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml diff --git a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py index 4201cdb4..b200b75a 100755 --- a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py +++ b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py @@ -204,9 +204,8 @@ for section in config_parser_merged.sections(): if "volume_size" not in section_all_machines: section_all_machines.update(volume_size="10") if "labels" not in section_all_machines: - print("LABELS not Set in builder config") - print(section_all_machines) - exit(1) + # "section" is the name of the cloud agent, which is the default label + section_all_machines.update(labels=section) j2_template = Template(machinetemplate) section_all_machines.update(name_prefix=name_prefix) diff --git a/releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml b/releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml new file mode 100644 index 00000000..35fbe87b --- /dev/null +++ b/releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + When running create_jenkins_clouds_openstack_yaml.py, rather than quitting + if there are no labels defined, we can instead use the agent name + (e.g. "centos7-2c-1g") as the default label. This recreates the + functionality of the groovy scripts previously used. -- 2.16.6