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 <LuizEduardo.Bonatti@windriver.com>
This commit is contained in:
Luis Eduardo Bonatti 2024-07-26 15:29:31 -03:00
parent 48a7fa0d10
commit 5d1605cd62
2 changed files with 2 additions and 1 deletions

View File

@ -130,6 +130,7 @@ STORAGE = 'storage'
WORKER = 'worker'
AVAILABILITY_ONLINE = 'online'
AVAILABILITY_AVAILABLE = 'available'
ADMIN_LOCKED = 'locked'
ADMIN_UNLOCKED = 'unlocked'

View File

@ -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