From 5d1605cd6278adc6dec259059de7756403bb63ec Mon Sep 17 00:00:00 2001 From: Luis Eduardo Bonatti Date: Fri, 26 Jul 2024 15:29:31 -0300 Subject: [PATCH] Fix unlock validation for deploy activate and complete This commit [1] introduced a bug to the system by using AVAILABILITY_ONLINE to an unlock host instead AVAILABILITY_AVAILABLE. This commit correct this issue. [1]: https://review.opendev.org/c/starlingx/update/+/923801 Test Plan: PASS: Software deploy activate ran with success. Story: 2010676 Task: 50674 Change-Id: Ic89961ff4620c1727ff015f65d728ef2c4c6670b Signed-off-by: Luis Eduardo Bonatti --- software/software/constants.py | 1 + software/software/sysinv_utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/software/software/constants.py b/software/software/constants.py index 8ef02b7f..a250c049 100644 --- a/software/software/constants.py +++ b/software/software/constants.py @@ -130,6 +130,7 @@ STORAGE = 'storage' WORKER = 'worker' AVAILABILITY_ONLINE = 'online' +AVAILABILITY_AVAILABLE = 'available' ADMIN_LOCKED = 'locked' ADMIN_UNLOCKED = 'unlocked' diff --git a/software/software/sysinv_utils.py b/software/software/sysinv_utils.py index 0acd3140..32aa375f 100644 --- a/software/software/sysinv_utils.py +++ b/software/software/sysinv_utils.py @@ -63,7 +63,7 @@ def is_host_locked_and_online(host): def are_all_hosts_unlocked_and_online(): for ihost in get_ihost_list(): - if ihost.administrative != constants.ADMIN_UNLOCKED or ihost.availability != constants.AVAILABILITY_ONLINE: + if ihost.administrative != constants.ADMIN_UNLOCKED or ihost.availability != constants.AVAILABILITY_AVAILABLE: return False return True