Skip to content

Commit

Permalink
Fix unsafe asserts in software updates remote role
Browse files Browse the repository at this point in the history
  • Loading branch information
ppiwowa-csco committed Dec 9, 2024
1 parent e18f2c8 commit f4860ae
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions roles/software_upgrades_remote/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@
- name: "Verify that activated version appears as current version and as default version"
ansible.builtin.assert:
that:
- "'{{ controller_software_version_to_activate }}' in {{ software_info_vmanage.installed_devices | first }}.current_partition"
- "'{{ controller_software_version_to_activate }}' in {{ software_info_vmanage.installed_devices | first }}.default_version"
- "controller_software_version_to_activate in (software_info_vmanage.installed_devices | first).current_partition"
- "controller_software_version_to_activate in (software_info_vmanage.installed_devices | first).default_version"
fail_msg: "{{ software_info_vmanage.installed_devices | first | to_nice_yaml }}"
success_msg: "{{ software_info_vmanage.installed_devices | first | to_nice_yaml }}"

Expand Down Expand Up @@ -260,8 +260,8 @@
- name: "Verify that activated version appears as current version and as default version"
ansible.builtin.assert:
that:
- "'{{ controller_software_version_to_activate }}' in {{ device_item }}.current_partition"
- "'{{ controller_software_version_to_activate }}' in {{ device_item }}.default_version"
- "controller_software_version_to_activate in device_item.current_partition"
- "controller_software_version_to_activate in device_item.default_version"
fail_msg: "{{ device_item | to_nice_yaml }}"
success_msg: "{{ device_item | to_nice_yaml }}"
loop: "{{ software_info_vbond.installed_devices }}"
Expand Down Expand Up @@ -329,8 +329,8 @@
- name: "Verify that activated version appears as current version and as default version"
ansible.builtin.assert:
that:
- "'{{ controller_software_version_to_activate }}' in {{ device_item }}.current_partition"
- "'{{ controller_software_version_to_activate }}' in {{ device_item }}.default_version"
- "controller_software_version_to_activate in device_item.current_partition"
- "controller_software_version_to_activate in device_item.default_version"
fail_msg: "{{ device_item | to_nice_yaml }}"
success_msg: "{{ device_item | to_nice_yaml }}"
loop: "{{ software_info_vsmart.installed_devices }}"
Expand Down Expand Up @@ -397,8 +397,8 @@
- name: "Verify that activated version appears as current version and as default version"
ansible.builtin.assert:
that:
- "'{{ edge_software_version_to_activate }}' in {{ device_item }}.current_partition"
- "'{{ edge_software_version_to_activate }}' in {{ device_item }}.default_version"
- "edge_software_version_to_activate in device_item.current_partition"
- "edge_software_version_to_activate in device_item.default_version"
fail_msg: "{{ device_item | to_nice_yaml }}"
success_msg: "{{ device_item | to_nice_yaml }}"
loop: "{{ software_info_cedges.installed_devices }}"
Expand Down

0 comments on commit f4860ae

Please sign in to comment.