X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jenkins-admin%2Fcreate_jenkins_clouds_openstack_yaml.py;h=50c4c0385192fae87ef5d603c5694baa17c04482;hb=37f923f40d5a735f5bc67769ad1bcfb63c1abe3d;hp=ec11f455ecc845ddabcce32af5cc631481e6c390;hpb=9245b69650c0192d8793a3378271237070339be5;p=releng%2Fglobal-jjb.git diff --git a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py index ec11f455..50c4c038 100755 --- a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py +++ b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py @@ -97,7 +97,7 @@ jenkins: """ machinetemplate = """\ - labels: {{ labels }} - name: {{ name_prefix }}-{{ labels }} + name: {{ name_prefix }}-{{ agent_name }} slaveOptions: bootSource: {{ image_type }}: @@ -201,14 +201,19 @@ for section in config_parser_merged.sections(): value = lookuptable[value] section_all_machines[key] = value - # Default volume size of 10 if "volume_size" not in section_all_machines: section_all_machines.update(image_type="image") else: section_all_machines.update(image_type="volumeFromImage") + + # Naming and labels + section_all_machines.update(agent_name=section) if "labels" not in section_all_machines: # "section" is the name of the cloud agent, which is the default label section_all_machines.update(labels=section) + elif section not in section_all_machines["labels"]: + labels = section + " " + section_all_machines["labels"] + section_all_machines.update(labels=labels) j2_template = Template(machinetemplate) section_all_machines.update(name_prefix=name_prefix)