Carry over fixes from @alexAubin

Lost during the rebasing but revived!
This commit is contained in:
Luke Murphy 2019-09-23 13:36:50 +02:00
parent 74a5979e91
commit c15311f7e7
No known key found for this signature in database
GPG key ID: 5E2EF5A63E3718CC

View file

@ -2903,11 +2903,7 @@ def is_true(arg):
if isinstance(arg, bool):
return arg
elif isinstance(arg, basestring):
true_list = ['yes', 'true', 'on']
for string in true_list:
if arg.lower() == string:
return True
return False
return arg.lower() in ['yes', 'true', 'on']
else:
logger.debug('arg should be a boolean or a string, got %r', arg)
return True if arg else False