Use custom strtobool to handle weird edge cases
This commit is contained in:
		| @@ -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'] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user