Use custom strtobool to handle weird edge cases
This commit is contained in:
		| @@ -30,7 +30,7 @@ import time | ||||
| import shlex | ||||
| import subprocess | ||||
|  | ||||
| from distutils.util import strtobool | ||||
| from distutils.util import strtobool as dustrtobool | ||||
|  | ||||
| import daemon_lib.common as pvc_common | ||||
| import daemon_lib.node as pvc_node | ||||
| @@ -42,6 +42,13 @@ import pvcapid.libvirt_schema as libvirt_schema | ||||
|  | ||||
| from pvcapid.ova import list_ova | ||||
|  | ||||
| def strtobool(stringv): | ||||
|     if stringv is None: | ||||
|         return False | ||||
|     if isinstance(stringv, bool): | ||||
|         return bool(stringv) | ||||
|     return bool(dustrtobool(stringv)) | ||||
|  | ||||
| # | ||||
| # Exceptions (used by Celery tasks) | ||||
| # | ||||
|   | ||||
		Reference in New Issue
	
	Block a user