summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2018-02-12 16:14:18 +0100
committerMatt Davis <mrd@redhat.com>2018-02-22 16:36:29 -0800
commit917e5ae5d842f94f299998facd0e0657093bce8f (patch)
tree3c12e2b840578f93f54dd97bd56d60b43800e2f2
parented9781bbfbb980ef30f094ba1ca6334a1e363858 (diff)
downloadansible-917e5ae5d842f94f299998facd0e0657093bce8f.tar.gz
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, ... (cherry picked from commit 487cf0ee8d15b77fb98de38a14eddff10f3ec85b)
-rw-r--r--lib/ansible/module_utils/parsing/convert_bool.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/parsing/convert_bool.py b/lib/ansible/module_utils/parsing/convert_bool.py
index 0462091d81..e0516efd86 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)))