Remove incorrect host validation from deploy host

Now with the state machine introduced by commit [1], the host
state validation once done by [2] is not needed anymore, and in
fact was incorrectly blocking the "deploy host" command from
being reentrant.

This commit fixes this issue.

Test Plan
PASS: force "deploy host" to fail, then once the host is in "failed"
      state, run deploy "host again" and verify the system does not
      block it from proceeding

Story: 2010676
Task: 49938

Change-Id: I0d2a8a4ab9ea98f83fbd7253cf4f174a257ee070
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui 2024-04-24 14:09:13 -03:00
parent c5a7d1d336
commit 07ab45e4e8
1 changed files with 0 additions and 17 deletions

View File

@ -1337,25 +1337,9 @@ def set_host_target_load(hostname, major_release):
raise
def validate_host_state_to_deploy_host(hostname):
"""
Check if the deployment host state for the hostname is pending.
If the validation fails raise SoftwareServiceError exception.
:param hostname: Hostname of the host to be deployed
"""
host_state = get_instance().get_deploy_host_by_hostname(hostname).get("state")
if host_state != states.DEPLOY_HOST_STATES.PENDING.value:
msg = (f"Host state is {host_state} and should be "
f"{states.DEPLOY_HOST_STATES.PENDING.value}")
raise SoftwareServiceError(msg)
def deploy_host_validations(hostname):
"""
Check the conditions below:
Host state is pending.
If system mode is duplex, check if provided hostname satisfy the right deployment order.
Host is locked and online.
@ -1364,7 +1348,6 @@ def deploy_host_validations(hostname):
:param hostname: Hostname of the host to be deployed
"""
validate_host_state_to_deploy_host(hostname)
_, system_mode = get_system_info()
simplex = (system_mode == constants.SYSTEM_MODE_SIMPLEX)
if simplex: