From 4c6d68dd2e460095e20ba32007a35da4c5e6dae6 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 26 Sep 2017 22:50:27 +0200 Subject: Fix more PEP-8 violations --- opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc/api/v1') diff --git a/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py b/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py index cd96f97f..e0155c7c 100644 --- a/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py +++ b/opendc/api/v1/datacenters/datacenterId/rooms/endpoint.py @@ -85,7 +85,7 @@ def POST(request): # Add a name if not provided - if not 'name' in request.params_body['room']: + if 'name' not in request.params_body['room']: room_count = len(Room.query('datacenter_id', datacenter.id)) request.params_body['room']['name'] = 'Room {}'.format(room_count) @@ -97,7 +97,7 @@ def POST(request): try: room.insert() - except Exception as e: + except: return Response(400, 'Invalid `roomType` or existing `name`.') # Return this Room -- cgit v1.2.3