Merge "Allow upgrade-related health checks to use --force"
This commit is contained in:
commit
6d22561256
|
@ -16,12 +16,16 @@ class HealthManager(base.Manager):
|
||||||
resp, body = self.api.json_request('GET', path)
|
resp, body = self.api.json_request('GET', path)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def get_upgrade(self):
|
def get_upgrade(self, relaxed=None):
|
||||||
path = '/v1/health/upgrade'
|
path = '/v1/health/upgrade'
|
||||||
|
if relaxed:
|
||||||
|
path += '/relaxed'
|
||||||
resp, body = self.api.json_request('GET', path)
|
resp, body = self.api.json_request('GET', path)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def get_kube_upgrade(self):
|
def get_kube_upgrade(self, relaxed=None):
|
||||||
path = '/v1/health/kube-upgrade'
|
path = '/v1/health/kube-upgrade'
|
||||||
|
if relaxed:
|
||||||
|
path += '/relaxed'
|
||||||
resp, body = self.api.json_request('GET', path)
|
resp, body = self.api.json_request('GET', path)
|
||||||
return body
|
return body
|
||||||
|
|
|
@ -33,13 +33,16 @@ class HealthController(rest.RestController):
|
||||||
"Unable to perform health query."))
|
"Unable to perform health query."))
|
||||||
return output
|
return output
|
||||||
|
|
||||||
@wsme_pecan.wsexpose(wtypes.text, wtypes.text)
|
@wsme_pecan.wsexpose(wtypes.text, wtypes.text, wtypes.text)
|
||||||
def get_one(self, upgrade):
|
def get_one(self, upgrade, relaxed=None):
|
||||||
"""Validates the health of the system for an upgrade"""
|
"""Validates the health of the system for an upgrade"""
|
||||||
|
force = False
|
||||||
|
if relaxed:
|
||||||
|
force = True
|
||||||
if upgrade == 'upgrade':
|
if upgrade == 'upgrade':
|
||||||
try:
|
try:
|
||||||
success, output = pecan.request.rpcapi.get_system_health(
|
success, output = pecan.request.rpcapi.get_system_health(
|
||||||
pecan.request.context, upgrade=True)
|
pecan.request.context, upgrade=True, force=force)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(e)
|
LOG.exception(e)
|
||||||
raise wsme.exc.ClientSideError(_(
|
raise wsme.exc.ClientSideError(_(
|
||||||
|
@ -48,7 +51,7 @@ class HealthController(rest.RestController):
|
||||||
elif upgrade == 'kube-upgrade':
|
elif upgrade == 'kube-upgrade':
|
||||||
try:
|
try:
|
||||||
success, output = pecan.request.rpcapi.get_system_health(
|
success, output = pecan.request.rpcapi.get_system_health(
|
||||||
pecan.request.context, kube_upgrade=True)
|
pecan.request.context, kube_upgrade=True, force=force)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception(e)
|
LOG.exception(e)
|
||||||
raise wsme.exc.ClientSideError(_(
|
raise wsme.exc.ClientSideError(_(
|
||||||
|
|
Loading…
Reference in New Issue