From 487cf0ee8d15b77fb98de38a14eddff10f3ec85b Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Mon, 12 Feb 2018 16:14:18 +0100 Subject: [PATCH] Improve convert_bool error message The error message as it was confused me when the value was 'enabled' and there was also a module parameter named 'enabled'. enabled is not a valid boolean. Valid booleans include: yes, on, 1, true, ... So by clearly describing it as a value, the confusion would have been avoided. The value 'enabled' is not a valid boolean. Valid booleans include: yes, on, 1, true, ... --- lib/ansible/module_utils/parsing/convert_bool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/parsing/convert_bool.py b/lib/ansible/module_utils/parsing/convert_bool.py index 0462091d815..e0516efd86f 100644 --- a/lib/ansible/module_utils/parsing/convert_bool.py +++ b/lib/ansible/module_utils/parsing/convert_bool.py @@ -23,4 +23,4 @@ def boolean(value, strict=True): elif normalized_value in BOOLEANS_FALSE or not strict: return False - raise TypeError('%s is not a valid boolean. Valid booleans include: %s' % (to_text(value), ', '.join(repr(i) for i in BOOLEANS))) + raise TypeError("The value '%s' is not a valid boolean. Valid booleans include: %s" % (to_text(value), ', '.join(repr(i) for i in BOOLEANS)))