Fix a bug in Managr HTTP server 31/54331/1
authorThomas Duval <thomas.duval@orange.com>
Thu, 22 Mar 2018 16:33:21 +0000 (17:33 +0100)
committerThomas Duval <thomas.duval@orange.com>
Thu, 22 Mar 2018 16:33:21 +0000 (17:33 +0100)
Change-Id: If29c9971e171e78e20aa02a3bff1b01ec46e6e30

moon_manager/moon_manager/http_server.py

index 128d5b7..a7258a7 100644 (file)
@@ -100,7 +100,7 @@ class Root(Resource):
                 if _method in dir(item):
                     _methods.append(_method)
             tree[item.__name__]["methods"] = _methods
-            tree[item.__name__]["description"] = item.__doc__.strip()
+            tree[item.__name__]["description"] = item.__doc__.strip() if item.__doc__ else ""
         return {
             "version": __version__,
             "tree": tree
@@ -147,7 +147,7 @@ class HTTPServer(Server):
         while True:
             try:
                 PDPManager.get_pdp(user_id="admin", pdp_id=None)
-            except sqlalchemy.exc.ProgrammingError:
+            except (sqlalchemy.exc.ProgrammingError, sqlalchemy.exc.InternalError):
                 time.sleep(1)
                 if first:
                     logger.warning("Waiting for the database...")