From b89e53fd70a43a4cf772f5d0e08e99cce37dc737 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 1 Feb 2019 01:10:56 +0000 Subject: [PATCH] ansible: raise error with correct exception type. --- ansible_mitogen/connection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ansible_mitogen/connection.py b/ansible_mitogen/connection.py index 6e072a80..c7e70c43 100644 --- a/ansible_mitogen/connection.py +++ b/ansible_mitogen/connection.py @@ -76,7 +76,9 @@ def convert_bool(obj): if str(obj).lower() in ('no', 'false', '0'): return False if str(obj).lower() not in ('yes', 'true', '1'): - raise ValueError('expected yes/no/true/false/0/1, got %r' % (obj,)) + raise ansible.errors.AnsibleConnectionFailure( + 'expected yes/no/true/false/0/1, got %r' % (obj,) + ) return True