X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jenkins-admin%2Fcreate_jenkins_clouds_openstack_yaml.py;h=d3424698bfb6d958d1d74afa0e5616142a805ea2;hb=0ff7cbacb76c80c8e2222d6d5917de5119c0d8fd;hp=2b81f345d36a62365fd3c556ebbb7a7404220a04;hpb=502523b6c679aea37113ebd6711fbcb9cbae8e1a;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 2b81f345..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 %} @@ -125,7 +126,7 @@ machinetemplate = """\ {%- if instance_cap %} instanceCap: {{ instance_cap }}{% endif %} {%- if num_executors %} - numExectorts: {{ num_executors }}{% endif %} + numExecutors: {{ num_executors }}{% endif %} {%- if retention_time %} retentionTime: {{ retention_time }} {%- else %} @@ -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))