[openstack-dev] [all] cross project communication: Return request-id to caller
Abhishek.Kekane at nttdata.com
Fri Dec 18 06:27:59 UTC 2015
I have submitted a cross-project specs  for returning request-id to the caller which was approved. For implementation we have submitted patches in python-cinderclient  as per design in cross-project specs. However we have found one issue while implementing this design in python-glanceclient and submitted a lite-spec  to address this issue.
As per the comments  on lite-specs, glance core are suggesting new approach to use hooks and pass empty list to each of the api, so that when the hook is executed it will append the request-id to the list.
POC code for approach suggested by glance:
# change in python-glanceclient/v2/images.py to delete api
def append_request_id(req_id_lst, response, *args, **kwargs):
req_id = response.headers.get('x-openstack-request-id')
if req_id_lst is not None:
return dict(response=functools.partial(append_request_id, req_id_lst))
def delete(self, image_id, request_ids=None):
hook = setup_request_id_hook(request_ids)
url = '/v2/images/%s' % image_id
# modify the do_image_delete function (glanceclient/v2/shell.py) to look as follows:
request_ids = 
$ glance image-delete 11887d68-7faf-4821-9a42-3ec63451067c
We have tested this approach and it is working as per expectation, only thing is that we need to make changes in every method to add hook and request_id list.
>From third-party tools, user need to pass this request-ids list as mentioned in above poc in order to get the request-id back.
My point here is, should we follow this new approach in all python-clients to maintain the consistency across openstack?
Please provide your feedback for the same.
 https://review.openstack.org/#/c/257170/ (base patch, followed by dependent patches)
 https://bugs.launchpad.net/glance/+bug/1525259/comments/1 and https://bugs.launchpad.net/glance/+bug/1525259/comments/5
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev