From 5ec768a6eba4a4d15d1db362e2463db1a32c57ed Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 31 Mar 2020 09:46:44 +0000 Subject: [PATCH] fix 1046. Allow auth_internal.user_list filtering with the _id Change-Id: I94e190dc3e104a7f98a085368cb0d4ba13a719cd Signed-off-by: tierno --- osm_nbi/__init__.py | 4 ++-- osm_nbi/admin_topics.py | 6 +++--- osm_nbi/authconn_internal.py | 19 ++++++++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/osm_nbi/__init__.py b/osm_nbi/__init__.py index 1644d0b..2c895ce 100644 --- a/osm_nbi/__init__.py +++ b/osm_nbi/__init__.py @@ -12,8 +12,8 @@ # under the License. ## -version = '7.0.0.post11' -version_date = '2019-02-04' +version = '7.0.1.post17' +version_date = '2019-03-31' # Obtain installed package version. Ignore if error, e.g. pkg_resources not installed try: diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 9ecb61b..df31e90 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -655,7 +655,7 @@ class UserTopicAuth(UserTopic): Get complete information on an topic :param session: contains "username", "admin", "force", "public", "project_id", "set_project" - :param _id: server internal id + :param _id: server internal id or username :return: dictionary, raise exception if not found. """ # Allow _id to be a name or uuid @@ -665,9 +665,9 @@ class UserTopicAuth(UserTopic): if len(users) == 1: return users[0] elif len(users) > 1: - raise EngineException("Too many users found", HTTPStatus.CONFLICT) + raise EngineException("Too many users found for '{}'".format(_id), HTTPStatus.CONFLICT) else: - raise EngineException("User not found", HTTPStatus.NOT_FOUND) + raise EngineException("User '{}' not found".format(_id), HTTPStatus.NOT_FOUND) def edit(self, session, _id, indata=None, kwargs=None, content=None): """ diff --git a/osm_nbi/authconn_internal.py b/osm_nbi/authconn_internal.py index 88b276d..b8cfe5b 100644 --- a/osm_nbi/authconn_internal.py +++ b/osm_nbi/authconn_internal.py @@ -28,12 +28,13 @@ __author__ = "Pedro de la Cruz Ramos , " \ "Alfonso Tierno