Conform validation responses to status standard

Updates the message body of the validation response to use
the standards being proposed for ucp integration, whereby the
status values of "Valid" and "Invalid" are traded for "Success"
and "Failure". This  better aligns the validation status reponse with
the regular status response.

Change-Id: Id0009c6dbde8738bfad7f1f765cdaf9d0212662e
This commit is contained in:
Bryan Strassner 2017-12-11 22:14:46 -06:00
parent 253c6f6bb4
commit 693d71cd61

View File

@ -39,7 +39,7 @@ class ValidationResource(StatefulResource):
# create resp message
resp_message = {
'kind': 'Status',
'apiVersion': 'v1',
'apiVersion': 'v1.0',
'metaData': {},
'status': '',
'message': '',
@ -77,13 +77,13 @@ class ValidationResource(StatefulResource):
]
if message.error_count == 0:
resp_message['status'] = 'Valid'
resp_message['status'] = 'Success'
resp_message['message'] = 'Drydock Validations succeeded'
resp_message['code'] = 200
resp.status = falcon.HTTP_200
resp.body = json.dumps(resp_message)
else:
resp_message['status'] = 'Invalid'
resp_message['status'] = 'Failure'
resp_message['message'] = 'Drydock Validations failed'
resp_message['code'] = 400
resp.status = falcon.HTTP_400