ansible: raise error with correct exception type.

This commit is contained in:
David Wilson 2019-02-01 01:10:56 +00:00
parent 0e193c223c
commit b89e53fd70
1 changed files with 3 additions and 1 deletions

View File

@ -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