X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jenkins-admin%2Fcreate_jenkins_clouds_openstack_yaml.py;h=d3424698bfb6d958d1d74afa0e5616142a805ea2;hb=2c01d1c4b9b284118e2854494366e76d41e447f8;hp=a1464a5de7b273a2e6f1ceb0ea7a2f536b7fc7d7;hpb=918a6dd6692d7da97dadfaec75702ceb67e64c6e;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 a1464a5d..d3424698 100755 --- a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py +++ b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py @@ -93,9 +93,10 @@ jenkins: slaveOptions: availabilityZone: {{ availability_zone }} bootSource: - volumeFromImage: + {{ image_type }}: name: {{ image_name }} - volumeSize: {{ volume_size }} +{%- if image_type == "volumeFromImage" %} + volumeSize: {{ volume_size }}{% endif %} fsRoot: {{ fs_root }} hardwareId: {{ hardware_id }} {%- if is_sandbox is defined %} @@ -201,6 +202,11 @@ for index, _ in enumerate(cloud_config_final): value = lookuptable[value] section_cloud[key] = value + if "volume_size" not in section_cloud: + section_cloud.update(image_type="image") + else: + section_cloud.update(image_type="volumeFromImage") + j2_template = Template(maintemplate) print(j2_template.render(section_cloud))