ansible: raise error with correct exception type.

pull/564/head
David Wilson 6 years ago
parent 0e193c223c
commit b89e53fd70

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

Loading…
Cancel
Save