X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jenkins-admin%2Fcreate_jenkins_clouds_openstack_yaml.py;h=ec11f455ecc845ddabcce32af5cc631481e6c390;hb=9245b69650c0192d8793a3378271237070339be5;hp=b200b75a12d601c363500240f8f350345ba7a44b;hpb=28c06872f86a6d432e89ab4923bb807145e3aefc;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 b200b75a..ec11f455 100755 --- a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py +++ b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py @@ -100,9 +100,10 @@ machinetemplate = """\ name: {{ name_prefix }}-{{ labels }} slaveOptions: bootSource: - volumeFromImage: + {{ image_type }}: name: {{ image_name }} - volumeSize: {{ volume_size }} +{%- if image_type == "volumeFromImage" %} + volumeSize: {{ volume_size }}{% endif %} {%- if hardware_id %} hardwareId: {{ hardware_id }}{% endif %} {%- if instance_cap %} @@ -202,7 +203,9 @@ for section in config_parser_merged.sections(): # Default volume size of 10 if "volume_size" not in section_all_machines: - section_all_machines.update(volume_size="10") + section_all_machines.update(image_type="image") + else: + section_all_machines.update(image_type="volumeFromImage") 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)