'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
- else:
+ elif 'errors' in res.keys():
response_attribute = res['errors']['error'][0]
+ else:
+ # status code 400 invalid request
+ response_attribute = res['message'] + ' ' + res['url']
+ print(response_attribute)
return {'status_code': response.status_code,
attribute: response_attribute}