From 37620c753acf540e3c16364419617ebeb0388c5b Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Wed, 30 Jan 2019 13:40:15 -0500 Subject: Fixed all Flake8 errors Change-Id: I1186429df8989461e2384f1f3e533c55cebfb1b4 Signed-off-by: Parker Berberian --- src/api/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/api') diff --git a/src/api/models.py b/src/api/models.py index b14ea2f..30f0f75 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -42,7 +42,7 @@ class LabManagerTracker(object): """ try: lab = Lab.objects.get(name=lab_name) - except: + except Exception: raise PermissionDenied("Lab not found") if lab.api_token == token: return LabManager(lab) @@ -366,7 +366,7 @@ class AccessConfig(TaskConfig): d['revoke'] = self.revoke try: d['context'] = json.loads(self.context) - except: + except Exception: pass return d @@ -753,7 +753,7 @@ class JobFactory(object): job = None try: job = Job.objects.get(booking=booking) - except: + except Exception: job = Job.objects.create(status=JobStatus.NEW, booking=booking) cls.makeHardwareConfigs( hosts=hosts, @@ -796,7 +796,7 @@ class JobFactory(object): hardware_config = None try: hardware_config = HardwareConfig.objects.get(relation__host=host) - except: + except Exception: hardware_config = HardwareConfig() relation = HostHardwareRelation() @@ -839,7 +839,7 @@ class JobFactory(object): network_config = None try: network_config = NetworkConfig.objects.get(relation__host=host) - except: + except Exception: network_config = NetworkConfig.objects.create() relation = HostNetworkRelation() @@ -878,5 +878,5 @@ class JobFactory(object): software_relation = SoftwareRelation.objects.create(job=job, config=software_config) software_relation.save() return software_relation - except: + except Exception: return None -- cgit 1.2.3-korg