Use custom strtobool to handle weird edge cases

This commit is contained in:
2020-03-06 09:40:13 -05:00
parent 36588a3a81
commit d36d8e0637
3 changed files with 24 additions and 3 deletions

View File

@ -28,7 +28,7 @@ import gevent.pywsgi
import flask
from distutils.util import strtobool
from distutils.util import strtobool as dustrtobool
from functools import wraps
@ -45,6 +45,13 @@ from flask_sqlalchemy import SQLAlchemy
API_VERSION = 1.0
def strtobool(stringv):
if stringv is None:
return False
if isinstance(stringv, bool):
return bool(stringv)
return bool(dustrtobool(stringv))
# Parse the configuration file
try:
pvc_config_file = os.environ['PVC_CONFIG_FILE']