Skip to content

Commit a34ad53

Browse files
authored
Merge pull request #2108 from rackerlabs/PUC-1749-20260701-1140
fix(ansible): Updates nova-post-deploy to gracefully handle empty flavor data
2 parents 0811678 + f9b86b5 commit a34ad53

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • ansible/roles/nova_flavors/tasks

ansible/roles/nova_flavors/tasks/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
}
3131
})
3232
}}
33-
loop: "{{ device_types_data | selectattr('class', 'equalto', 'server') | selectattr('resource_class', 'defined') | subelements('resource_class') }}"
33+
loop: "{{ device_types_data | d([]) | selectattr('class', 'equalto', 'server') | selectattr('resource_class', 'defined') | subelements('resource_class') }}"
34+
when: device_types_data | d([]) | length > 0
3435

3536
- name: Loop through flavors and create Nova flavors
3637
ansible.builtin.include_tasks: nova_flavors.yml
37-
loop: "{{ flavors_data }}"
38+
loop: "{{ flavors_data | d([]) }}"
3839
loop_control:
3940
loop_var: flavor_item
4041

0 commit comments

Comments
 (0)