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

@ -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)
#