set debug=False to prevent useless tracebacks 71/52571/3
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Sat, 24 Feb 2018 08:46:51 +0000 (16:46 +0800)
committerSerenaFeng <feng.xiaowei@zte.com.cn>
Mon, 26 Feb 2018 02:03:35 +0000 (10:03 +0800)
Change-Id: Ide0e00e3aa6ee4a484fd9d1b7c9bc52b598267ea
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
testapi/etc/config.ini
testapi/opnfv_testapi/handlers/result_handlers.py
testapi/opnfv_testapi/tests/unit/common/test_config.py

index 86cb0ca..5f568a7 100644 (file)
@@ -15,7 +15,7 @@ port = 8000
 results_per_page = 20
 
 # With debug_on set to true, error traces will be shown in HTTP responses
-debug = True
+debug = False
 token_check = False
 authenticate = True
 
index b0691cd..2d4280f 100644 (file)
@@ -245,6 +245,8 @@ class ResultsUploadHandler(ResultsCLHandler):
             @raise 400: body/pod_name/project_name/case_name not provided
         """
         logging.info('file upload')
+        if not self.request.files:
+            raises.NotFound(message.key_error('file'))
         fileinfo = self.request.files['file'][0]
         is_public = self.get_body_argument('public')
         logging.warning('public:%s', is_public)
index 6d160ce..8e4966f 100644 (file)
@@ -11,7 +11,7 @@ def test_config_normal(mocker, config_normal):
     assert CONF.mongo_url == 'mongodb://127.0.0.1:27017/'
     assert CONF.mongo_dbname == 'test_results_collection'
     assert CONF.api_port == 8000
-    assert CONF.api_debug is True
+    assert CONF.api_debug is False
     assert CONF.api_token_check is False
     assert CONF.api_authenticate is True
     assert CONF.ui_url == 'http://localhost:8000'