bugfix: E722 do not use bare except
[releng.git] / utils / test / testapi / opnfv_testapi / common / config.py
index ecfffd8..f888b07 100644 (file)
@@ -20,10 +20,6 @@ class Config(object):
         self._set_config_file()
         self._parse()
         self._parse_per_page()
-        self.static_path = os.path.join(
-            os.path.dirname(os.path.normpath(__file__)),
-            os.pardir,
-            'static')
 
     def _parse(self):
         if not os.path.exists(self.config_file):
@@ -48,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':
@@ -60,7 +56,7 @@ class Config(object):
         parser.add_argument("-c", "--config-file", dest='config_file',
                             help="Config file location", metavar="FILE")
         args, _ = parser.parse_known_args(sys.argv)
-        if hasattr(args, 'config_file'):
+        if hasattr(args, 'config_file') and args.config_file:
             self.config_file = args.config_file