Fix: Use cloud agent name as default node label 07/68507/2 v0.65.2
authorEric Ball <eball@linuxfoundation.org>
Tue, 10 Aug 2021 21:50:42 +0000 (14:50 -0700)
committerEric Ball <eball@linuxfoundation.org>
Tue, 10 Aug 2021 22:01:06 +0000 (15:01 -0700)
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 <eball@linuxfoundation.org>
jenkins-admin/create_jenkins_clouds_openstack_yaml.py
releasenotes/notes/fix-jcasc-openstack-bbe5b39391fe5f59.yaml [new file with mode: 0644]

index 4201cdb..b200b75 100755 (executable)
@@ -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 (file)
index 0000000..35fbe87
--- /dev/null
@@ -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.