bugfix: E722 do not use bare except 89/46289/1
authorSerenaFeng <feng.xiaowei@zte.com.cn>
Fri, 27 Oct 2017 07:45:20 +0000 (15:45 +0800)
committerSerenaFeng <feng.xiaowei@zte.com.cn>
Fri, 27 Oct 2017 07:45:20 +0000 (15:45 +0800)
new added pep8 check: https://build.opnfv.org/ci/job/testapi-verify-master/435/console

Change-Id: I29c1ffbb534babf55ec2fe675001cc85b9e2e922
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
utils/test/testapi/opnfv_testapi/common/config.py
utils/test/testapi/opnfv_testapi/resources/models.py
utils/test/testapi/opnfv_testapi/resources/result_handlers.py

index 140e492..f888b07 100644 (file)
@@ -44,7 +44,7 @@ class Config(object):
     def _parse_value(value):
         try:
             value = int(value)
-        except:
+        except Exception:
             if str(value).lower() == 'true':
                 value = True
             elif str(value).lower() == 'false':
index e70a6ed..27396d1 100644 (file)
@@ -91,10 +91,10 @@ class ModelBase(object):
         elif isinstance(obj, unicode):
             try:
                 obj = self._obj_format(ast.literal_eval(obj))
-            except:
+            except Exception:
                 try:
                     obj = str(obj)
-                except:
+                except Exception:
                     obj = obj
         elif isinstance(obj, list):
             hs = list()
index a258528..4cd533c 100644 (file)
@@ -33,7 +33,7 @@ class GenericResultHandler(handlers.GenericApiHandler):
     def get_int(self, key, value):
         try:
             value = int(value)
-        except:
+        except Exception:
             raises.BadRequest(message.must_int(key))
         return value