summaryrefslogtreecommitdiff
path: root/keystoneclient/v3
diff options
context:
space:
mode:
authorMaho Koshiya <koshiya.maho@po.ntts.co.jp>2016-09-03 09:13:37 +0900
committerdineshbhor <dinesh.bhor@nttdata.com>2018-03-26 01:55:58 -0700
commitd3ea00e6d85a2dce09851fc9b05d67cdb6266ecd (patch)
treed440b86bc67650c267104079a18fbfea1f2ce1fe /keystoneclient/v3
parentb2e9caee38ca66147552a8f677468becf812e16e (diff)
downloadpython-keystoneclient-d3ea00e6d85a2dce09851fc9b05d67cdb6266ecd.tar.gz
Add return-request-id-to-caller function(v3)
Added return-request-id-to-caller function to resources and resource managers in the following files. * keystoneclient/v3/projects.py The methods in the resource class and resource manager return a wrapper class that has 'request_ids' property. The caller can get request ids of the callee via the property. NOTE: Remaining resources from the V3 package are already covered in the base patch: https://review.openstack.org/#/c/329913/ Change-Id: I0133d51cfadc02e2dd926b8b0419b2e1dd0fa92a Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com> Co-authored-by: Dinesh Bhor <dinesh.bhor@nttdata.com> Implements: blueprint return-request-id-to-caller
Diffstat (limited to 'keystoneclient/v3')
-rw-r--r--keystoneclient/v3/projects.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/keystoneclient/v3/projects.py b/keystoneclient/v3/projects.py
index 79f8c93..aa94293 100644
--- a/keystoneclient/v3/projects.py
+++ b/keystoneclient/v3/projects.py
@@ -136,9 +136,21 @@ class ProjectManager(base.CrudManager):
domain_id=base.getid(domain),
fallback_to_auth=True,
**kwargs)
- for p in projects:
+
+ base_response = None
+ list_data = projects
+ if self.client.include_metadata:
+ base_response = projects
+ list_data = projects.data
+ base_response.data = list_data
+
+ for p in list_data:
p.tags = self._encode_tags(getattr(p, 'tags', []))
- return projects
+
+ if self.client.include_metadata:
+ base_response.data = list_data
+
+ return base_response if self.client.include_metadata else list_data
def _check_not_parents_as_ids_and_parents_as_list(self, parents_as_ids,
parents_as_list):