summaryrefslogtreecommitdiff
path: root/keystoneclient/base.py
diff options
context:
space:
mode:
authorRodrigo Duarte Sousa <rodrigods@lsd.ufcg.edu.br>2015-01-26 12:47:00 -0300
committerRodrigo Duarte Sousa <rodrigods@lsd.ufcg.edu.br>2015-03-13 17:02:39 -0300
commit14ace4a5ded0bd4005928b42a4f337639bd90799 (patch)
tree2b71e008bbd775b160573ddd2713391772fd45de /keystoneclient/base.py
parent32c18a83e2ffe80f559ca871eeddb2ef8848ff17 (diff)
downloadpython-keystoneclient-14ace4a5ded0bd4005928b42a4f337639bd90799.tar.gz
Implements subtree_as_ids and parents_as_ids
This patch implements the new ways to get the project's hierarchy: 'subtree_as_ids': If True, returns projects IDs down the hierarchy as a structured dictionay. 'parents_as_ids': If True, returns projects IDs up the hierarchy as a structured dictionay. Change-Id: Ia3afe994893dfca059cb8361f7ab1c14e28e1ad5 Implements: blueprint hierarchical-multitenancy-improvements
Diffstat (limited to 'keystoneclient/base.py')
-rw-r--r--keystoneclient/base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/keystoneclient/base.py b/keystoneclient/base.py
index 81d5e26..2af38b9 100644
--- a/keystoneclient/base.py
+++ b/keystoneclient/base.py
@@ -340,6 +340,15 @@ class CrudManager(Manager):
def _build_query(self, params):
return '?%s' % urllib.parse.urlencode(params) if params else ''
+ def build_key_only_query(self, params_list):
+ """Builds a query that does not include values, just keys.
+
+ The Identity API has some calls that define queries without values,
+ this can not be accomplished by using urllib.parse.urlencode(). This
+ method builds a query using only the keys.
+ """
+ return '?%s' % '&'.join(params_list) if params_list else ''
+
@filter_kwargs
def list(self, fallback_to_auth=False, **kwargs):
url = self.build_url(dict_args_in_out=kwargs)