projects
/
osm
/
NBI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding filter to ProjectTopicAuth
[osm/NBI.git]
/
osm_nbi
/
authconn_keystone.py
diff --git
a/osm_nbi/authconn_keystone.py
b/osm_nbi/authconn_keystone.py
index
e917306
..
b0cab0c
100644
(file)
--- a/
osm_nbi/authconn_keystone.py
+++ b/
osm_nbi/authconn_keystone.py
@@
-347,10
+347,11
@@
class AuthconnKeystone(Authconn):
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:
@@
-360,6
+361,14
@@
class AuthconnKeystone(Authconn):
"_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")