From e128118419c3bb413de4cff8445b9b6c5598a5ed Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 22 May 2018 12:24:36 +0200 Subject: [PATCH] fix flake8 tests Change-Id: I1d02afb4c6372e761913e45f44da143dcf0eb993 Signed-off-by: tierno --- osm_nbi/engine.py | 4 ++-- osm_nbi/nbi.py | 16 ++++++++-------- .../{test => tests}/cirros_ns/cirros_nsd.yaml | 0 .../{test => tests}/cirros_ns/icons/osm_2x.png | Bin .../{test => tests}/cirros_vnf/cirros_vnfd.yaml | 0 .../cirros_vnf/icons/cirros-64.png | Bin osm_nbi/{test => tests}/create-ping-pong.sh | 0 osm_nbi/{test => tests}/delete-all.sh | 0 osm_nbi/{test => tests}/test.py | 0 osm_nbi/{test => tests}/upload.py | 0 tox.ini | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) rename osm_nbi/{test => tests}/cirros_ns/cirros_nsd.yaml (100%) rename osm_nbi/{test => tests}/cirros_ns/icons/osm_2x.png (100%) rename osm_nbi/{test => tests}/cirros_vnf/cirros_vnfd.yaml (100%) rename osm_nbi/{test => tests}/cirros_vnf/icons/cirros-64.png (100%) rename osm_nbi/{test => tests}/create-ping-pong.sh (100%) rename osm_nbi/{test => tests}/delete-all.sh (100%) rename osm_nbi/{test => tests}/test.py (100%) rename osm_nbi/{test => tests}/upload.py (100%) diff --git a/osm_nbi/engine.py b/osm_nbi/engine.py index ed35c7c..c13240d 100644 --- a/osm_nbi/engine.py +++ b/osm_nbi/engine.py @@ -857,8 +857,8 @@ class Engine(object): return folder_content, "text/plain" # TODO manage folders in http else: - return self.fs.file_open((storage['folder'], storage['pkg-dir'], *path), "rb"), \ - "application/octet-stream" + return self.fs.file_open((storage['folder'], storage['pkg-dir'], *path), "rb"),\ + "application/octet-stream" # pkgtype accept ZIP TEXT -> result # manyfiles yes X -> zip diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index a0229c8..ff8cd11 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -257,7 +257,7 @@ class Server(object): try: user_passwd = standard_b64decode(user_passwd64).decode() user, _, passwd = user_passwd.partition(":") - except: + except Exception: pass outdata = self.engine.new_token(None, {"username": user, "password": passwd}) token = outdata["id"] @@ -323,15 +323,15 @@ class Server(object): elif format_yaml: try: kwargs[k] = yaml.load(v) - except: + except Exception: pass elif k.endswith(".gt") or k.endswith(".lt") or k.endswith(".gte") or k.endswith(".lte"): try: kwargs[k] = int(v) - except: + except Exception: try: kwargs[k] = float(v) - except: + except Exception: pass elif v.find(",") > 0: kwargs[k] = v.split(",") @@ -342,7 +342,7 @@ class Server(object): elif format_yaml: try: v[index] = yaml.load(v[index]) - except: + except Exception: pass return indata @@ -449,7 +449,7 @@ class Server(object): elif method == "POST": try: session = self._authorization() - except: + except Exception: session = None if kwargs: indata.update(kwargs) @@ -488,7 +488,7 @@ class Server(object): thread_info = None if args and args[0] == "help": return "
\ninit\nfile/  download file\ndb-clear/table\nprune\nlogin\nlogin2\n"\
-                    "sleep/
" + "sleep/