Merge "check app progress before swact"

This commit is contained in:
Zuul 2021-05-07 12:53:49 +00:00 committed by Gerrit Code Review
commit 5d11877c68
1 changed files with 8 additions and 0 deletions

View File

@ -6081,6 +6081,14 @@ class HostController(rest.RestController):
raise wsme.exc.ClientSideError( raise wsme.exc.ClientSideError(
_("%s" % response['error_details'])) _("%s" % response['error_details']))
# Check no app apply is in progress
# Skip if it is a force swact
if force_swact is False:
for _app in pecan.request.dbapi.kube_app_get_all():
if _app.status == constants.APP_APPLY_IN_PROGRESS:
raise wsme.exc.ClientSideError(
_("Swact action not allowed. %s apply is in progress." % _app.name))
def check_lock_storage(self, hostupdate, force=False): def check_lock_storage(self, hostupdate, force=False):
"""Pre lock semantic checks for storage""" """Pre lock semantic checks for storage"""
LOG.info("%s ihost check_lock_storage" % hostupdate.displayid) LOG.info("%s ihost check_lock_storage" % hostupdate.displayid)