adding some comments to enahnce 99/50399/2
authorsgdt6900 <rhanafy.ext@orange.com>
Thu, 11 Jan 2018 09:57:43 +0000 (11:57 +0200)
committersgdt6900 <rhanafy.ext@orange.com>
Mon, 29 Jan 2018 15:33:27 +0000 (17:33 +0200)
removing comments and add todo point

Signed-off-by: sgdt6900 <rhanafy.ext@orange.com>
Change-Id: I38f21bd7557fb758b50d561a06efe8ea09ca07fc

docs/TODO.md
moon_interface/moon_interface/http_server.py
moon_interface/moon_interface/server.py

index afdadf3..caca158 100644 (file)
@@ -21,6 +21,8 @@ Bugs to fix:
 - When adding user or VM in GUI, there is a bug in the backend (manager ?)
 - GUI: in the "Projects" tab, move the "Map" link in the "Action" button
 - GUI: move tabs in this order : "Models, Policy, PDP, Projects"
+- Fixing Error Handling at module "Interface" & "Wrapper" according to this link 'http://flask-restful.readthedocs.io/en/0.3.5/extending.html#custom-error-handlers'
+- in case an error occurred, it would be better throwing an exception rather than sending result with error code (as the exception was already thrown in some cases ) [ Interface, Wrapper]
 
 Other actions:
 
index 82ee5d9..a2e2537 100644 (file)
@@ -114,12 +114,6 @@ class HTTPServer(Server):
         def get_400_json(e):
             return jsonify({"result": False, "code": 400, "description": str(e)}), 400
 
-        '''
-            [Note] i have tried to simulate authz post request (authz_Requests/run) to return 500 response code
-            and an AuthzException thrown from their [Line 63] and catched here , then the server here return response 
-            with 403 code [Forbidden] , is it correct if so why sometime at authz [from Line 137] return a response 
-            with error code , i think we can do it in the same way as the one mentioned?
-        '''
         self.app.register_error_handler(400, lambda e: get_400_json)
         self.app.register_error_handler(403, exceptions.AuthException)
 
index d38dae2..29403a6 100644 (file)
@@ -16,9 +16,7 @@ def create_server():
 
         conf = configuration.get_configuration("components/pipeline").get(
             "components/pipeline", {}).get("interface", {})
-        '''
-        [Note] i think pipeline should be changed to interface
-        '''
+
         hostname = conf.get("hostname", "pipeline")
         port = conf.get("port", 80)
         bind = conf.get("bind", "127.0.0.1")
@@ -26,9 +24,7 @@ def create_server():
         hostname = "interface"
         bind = "127.0.0.1"
         port = 80
-        '''
-        [Note] i think pipeline should be changed to interface
-        '''
+
         configuration.add_component(uuid="pipeline",
                                     name=hostname,
                                     port=port,