Removed local variable 'lowered_choices' because the value is never used (#76295)

pull/76303/head
Alex Holland 3 years ago committed by GitHub
parent a71ba817b0
commit c9d4b6bfb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -661,17 +661,13 @@ def _validate_argument_values(argument_spec, parameters, options_context=None, e
elif parameters[param] not in choices:
# 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.
lowered_choices = None
if parameters[param] == 'False':
lowered_choices = lenient_lowercase(choices)
overlap = BOOLEANS_FALSE.intersection(choices)
if len(overlap) == 1:
# Extract from a set
(parameters[param],) = overlap
if parameters[param] == 'True':
if lowered_choices is None:
lowered_choices = lenient_lowercase(choices)
overlap = BOOLEANS_TRUE.intersection(choices)
if len(overlap) == 1:
(parameters[param],) = overlap

Loading…
Cancel
Save