Skip to content

Commit

Permalink
feat: replace assert with fail when
Browse files Browse the repository at this point in the history
Related to #22

Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Feb 23, 2024
1 parent f51c70a commit 15b8136
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/bmc_fw_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
delegate_to: localhost

- name: Validate task was completed
ansible.builtin.assert: { that: "update_progress.redfish_facts.update_status.status == 'Completed'" }
ansible.builtin.fail:
msg: "{{ bmc_fw_update_task_failure | format(update_progress.redfish_facts.update_status.status) }}"
when: update_progress.redfish_facts.update_status.status != 'Completed'

- name: Reboot BMC to apply new firmware of DPU
ansible.builtin.include_role:
Expand Down
1 change: 1 addition & 0 deletions roles/bmc_fw_update/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
---
# vars file for bmc_fw_update

bmc_fw_update_task_failure: "Task failed with status: %s"
bmc_fw_update_image:
url: https://content.mellanox.com/BlueField/BMC/23.10-1-oct-2023
bmc: bf3-bmc-23.10-5_opn.fwpkg
Expand Down

0 comments on commit 15b8136

Please sign in to comment.