From c05e2986e658d9892c9d65203a1e2a785c68bf27 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Thu, 4 Oct 2018 12:42:16 +0300 Subject: Revive unit tests and flake8 of webportal JIRA: DOVETAIL-742 This patch revives unit test and flake8 tests of webportal. In addition, it fixes errors and enables handling of some uris which were forgotten. Change-Id: I8225c7ca08a3c97b6e77f00490defc91046a2dd6 Signed-off-by: Stamatis Katsaounis --- docker/db/get_db_schema.py | 8 ++++---- docker/db/init_db.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docker/db') diff --git a/docker/db/get_db_schema.py b/docker/db/get_db_schema.py index 1106355..16ed3da 100644 --- a/docker/db/get_db_schema.py +++ b/docker/db/get_db_schema.py @@ -18,7 +18,7 @@ def get(url): try: ret = requests.get(url) return ret.json() - except: + except Exception: return None @@ -28,7 +28,7 @@ def pod(): pods = get(source)['pods'] with open("pods.json", "w") as f: f.write(json.dumps(pods, indent=4)) - except: + except Exception: return @@ -39,7 +39,7 @@ def project(): projects = get(source)['projects'] with open("projects.json", "w") as f: f.write(json.dumps(projects, indent=4)) - except: + except Exception: return for p in projects: @@ -52,7 +52,7 @@ def project(): f.write(json.dumps(cases)) f.write('\n') f.close() - except: + except Exception: print("useless data") diff --git a/docker/db/init_db.py b/docker/db/init_db.py index 2aac6fc..afed693 100644 --- a/docker/db/init_db.py +++ b/docker/db/init_db.py @@ -58,7 +58,7 @@ def cases(): c['project_name']) print(target) post(target, c) - except: + except Exception: print("useless data") add_case("functest", "tempest_custom") -- cgit 1.2.3-korg