summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2d5a515)
Change-Id: I0bf340085f703540f810a969db368431d8b4774d
Signed-off-by: Eduardo Sousa <eduardo.sousa@canonical.com>
:param filter_q: filter of data to be applied
:return: The list, it can be empty if no one match the filter.
"""
:param filter_q: filter of data to be applied
:return: The list, it can be empty if no one match the filter.
"""
- return self.auth.get_project_list()
+ if not filter_q:
+ filter_q = {}
+
+ return self.auth.get_project_list(filter_q)
def delete(self, session, _id, dry_run=False):
"""
def delete(self, session, _id, dry_run=False):
"""
"""
raise AuthconnNotImplementedException("Should have implemented this")
"""
raise AuthconnNotImplementedException("Should have implemented this")
- def get_project_list(self):
+ def get_project_list(self, filter_q={}):
"""
Get all the projects.
"""
Get all the projects.
+ :param filter_q: dictionary to filter project list.
:return: list of projects
"""
raise AuthconnNotImplementedException("Should have implemented this")
:return: list of projects
"""
raise AuthconnNotImplementedException("Should have implemented this")
self.logger.exception("Error during role deletion using keystone")
raise AuthconnOperationException("Error during role deletion using Keystone")
self.logger.exception("Error during role deletion using keystone")
raise AuthconnOperationException("Error during role deletion using Keystone")
- def get_project_list(self):
+ def get_project_list(self, filter_q={}):
"""
Get all the projects.
"""
Get all the projects.
+ :param filter_q: dictionary to filter project list.
:return: list of projects
"""
try:
:return: list of projects
"""
try:
"_id": project.id
} for project in projects if project.name != self.admin_project]
"_id": project.id
} for project in projects if project.name != self.admin_project]
+ allowed_fields = ["_id", "name"]
+ for key in filter_q.keys():
+ if key not in allowed_fields:
+ continue
+
+ projects = [project for project in projects
+ if filter_q[key] == project[key]]
+
return projects
except ClientException:
self.logger.exception("Error during user project listing using keystone")
return projects
except ClientException:
self.logger.exception("Error during user project listing using keystone")