|
|
@ -661,17 +661,13 @@ def _validate_argument_values(argument_spec, parameters, options_context=None, e
|
|
|
|
elif parameters[param] not in choices:
|
|
|
|
elif parameters[param] not in choices:
|
|
|
|
# PyYaml converts certain strings to bools. If we can unambiguously convert back, do so before checking
|
|
|
|
# PyYaml converts certain strings to bools. If we can unambiguously convert back, do so before checking
|
|
|
|
# the value. If we can't figure this out, module author is responsible.
|
|
|
|
# the value. If we can't figure this out, module author is responsible.
|
|
|
|
lowered_choices = None
|
|
|
|
|
|
|
|
if parameters[param] == 'False':
|
|
|
|
if parameters[param] == 'False':
|
|
|
|
lowered_choices = lenient_lowercase(choices)
|
|
|
|
|
|
|
|
overlap = BOOLEANS_FALSE.intersection(choices)
|
|
|
|
overlap = BOOLEANS_FALSE.intersection(choices)
|
|
|
|
if len(overlap) == 1:
|
|
|
|
if len(overlap) == 1:
|
|
|
|
# Extract from a set
|
|
|
|
# Extract from a set
|
|
|
|
(parameters[param],) = overlap
|
|
|
|
(parameters[param],) = overlap
|
|
|
|
|
|
|
|
|
|
|
|
if parameters[param] == 'True':
|
|
|
|
if parameters[param] == 'True':
|
|
|
|
if lowered_choices is None:
|
|
|
|
|
|
|
|
lowered_choices = lenient_lowercase(choices)
|
|
|
|
|
|
|
|
overlap = BOOLEANS_TRUE.intersection(choices)
|
|
|
|
overlap = BOOLEANS_TRUE.intersection(choices)
|
|
|
|
if len(overlap) == 1:
|
|
|
|
if len(overlap) == 1:
|
|
|
|
(parameters[param],) = overlap
|
|
|
|
(parameters[param],) = overlap
|
|
|
|