This commit is contained in:
Liam Young 2015-09-04 11:33:49 +01:00
parent 9800cd7c28
commit 6db76cbf51
2 changed files with 5 additions and 1 deletions

View File

@ -35,10 +35,11 @@ def process_requests(reqs):
try: try:
version = reqs.get('api-version') version = reqs.get('api-version')
if version == 1: if version == 1:
log('Processing request {}'.format(request_id)) log('Processing request {}'.format(request_id), level=DEBUG)
resp = process_requests_v1(reqs['ops']) resp = process_requests_v1(reqs['ops'])
if request_id: if request_id:
resp['request-id'] = request_id resp['request-id'] = request_id
return resp return resp
except Exception as exc: except Exception as exc:
@ -52,6 +53,7 @@ def process_requests(reqs):
resp = {'exit-code': 1, 'stderr': msg} resp = {'exit-code': 1, 'stderr': msg}
if request_id: if request_id:
resp['request-id'] = request_id resp['request-id'] = request_id
return resp return resp

View File

@ -321,6 +321,8 @@ def client_relation_changed():
rsp = process_requests(settings['broker_req']) rsp = process_requests(settings['broker_req'])
unit_id = remote_unit().replace('/', '-') unit_id = remote_unit().replace('/', '-')
unit_response_key = 'broker-rsp-' + unit_id unit_response_key = 'broker-rsp-' + unit_id
# broker_rsp is being left for backward compatibility,
# unit_response_key superscedes it
data = { data = {
'broker_rsp': rsp, 'broker_rsp': rsp,
unit_response_key: rsp, unit_response_key: rsp,