mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
also strip strings to avoid spaces breaking match
This commit is contained in:
@@ -16,7 +16,7 @@ def boolean(value, strict=True):
|
|||||||
|
|
||||||
normalized_value = value
|
normalized_value = value
|
||||||
if isinstance(value, (text_type, binary_type)):
|
if isinstance(value, (text_type, binary_type)):
|
||||||
normalized_value = to_text(value, errors='surrogate_or_strict').lower()
|
normalized_value = to_text(value, errors='surrogate_or_strict').lower().strip()
|
||||||
|
|
||||||
if normalized_value in BOOLEANS_TRUE:
|
if normalized_value in BOOLEANS_TRUE:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user