Include "deployed" in valid deploy start states

This commit creates a list of valid deploy start states and
include "deployed" in the valid states to cover the patch
removal scenario, that is currently blocked.

This issue was introduced by [1].

[1] https://review.opendev.org/c/starlingx/update/+/906381

Test Plan
PASS: run deploy precheck/start for available release (patch install)
PASS: run deploy precheck/start for deployed release (patch remove)
PASS: run deploy precheck/start for release not in a valid state

Story: 2010676
Task: 49523

Change-Id: I300517e34aa795615586e51bf71ce7ddb1ca6f1f
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui 2024-02-05 10:14:27 -03:00
parent 283fe8c1ba
commit de070dbf3e
2 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,10 @@ REMOVING = 'removing'
UNAVAILABLE = 'unavailable'
UNKNOWN = 'n/a'
VALID_DEPLOY_START_STATES = [
AVAILABLE,
DEPLOYED,
]
STATUS_DEVELOPEMENT = 'DEV'
STATUS_OBSOLETE = 'OBS'

View File

@ -1883,7 +1883,7 @@ class PatchController(PatchService):
success = False
# Check if release state is valid
elif release["state"] not in [constants.AVAILABLE]:
elif release["state"] not in constants.VALID_DEPLOY_START_STATES:
msg = "Software release state is invalid: %s" % release["state"]
LOG.error(msg)
msg_error += msg