Lint: E722 do not use bare 'except'

This commit is contained in:
2020-11-06 18:55:10 -05:00
parent 601ab1a181
commit 63f4f9aed7
17 changed files with 89 additions and 89 deletions

View File

@ -53,13 +53,13 @@ def strtobool(stringv):
return bool(stringv)
try:
return bool(dustrtobool(stringv))
except:
except Exception:
return False
# Parse the configuration file
try:
pvc_config_file = os.environ['PVC_CONFIG_FILE']
except:
except Exception:
print('Error: The "PVC_CONFIG_FILE" environment variable must be set before starting pvcapid.')
exit(1)
@ -4205,11 +4205,11 @@ class API_Provisioner_Template_System_Root(Resource):
# Validate arguments
try:
vcpus = int(reqargs.get('vcpus'))
except:
except Exception:
return { "message": "A vcpus value must be an integer" }, 400
try:
vram = int(reqargs.get('vram'))
except:
except Exception:
return { "message": "A vram value must be an integer" }, 400
# Cast boolean arguments
if bool(strtobool(reqargs.get('serial', 'false'))):
@ -4345,11 +4345,11 @@ class API_Provisioner_Template_System_Element(Resource):
# Validate arguments
try:
vcpus = int(reqargs.get('vcpus'))
except:
except Exception:
return { "message": "A vcpus value must be an integer" }, 400
try:
vram = int(reqargs.get('vram'))
except:
except Exception:
return { "message": "A vram value must be an integer" }, 400
# Cast boolean arguments
if bool(strtobool(reqargs.get('serial', False))):