mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-01 12:24:43 +00:00
Fix excessive number of returns.
This commit is contained in:
@@ -294,16 +294,8 @@ else:
|
|||||||
# If both args and ipa are None, return there's no difference.
|
# If both args and ipa are None, return there's no difference.
|
||||||
# If only one is None, return there is a difference.
|
# If only one is None, return there is a difference.
|
||||||
# This tests avoid unecessary invalid access to attributes.
|
# This tests avoid unecessary invalid access to attributes.
|
||||||
if args is None and ipa is None:
|
|
||||||
return True
|
|
||||||
if args is None or ipa is None:
|
if args is None or ipa is None:
|
||||||
module.debug(
|
return args is None and ipa is None
|
||||||
base_debug_msg + "args is%s None an ipa is%s None" % (
|
|
||||||
"" if args is None else " not",
|
|
||||||
"" if ipa is None else " not",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Fail if args or ipa are not dicts.
|
# Fail if args or ipa are not dicts.
|
||||||
if not (isinstance(args, dict) and isinstance(ipa, dict)):
|
if not (isinstance(args, dict) and isinstance(ipa, dict)):
|
||||||
|
|||||||
@@ -269,16 +269,12 @@ class DNSZoneModule(FreeIPABaseModule):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not all([part1.isdigit(), part2.isdigit(), part3.isdigit()]):
|
if (
|
||||||
return False
|
not all([part1.isdigit(), part2.isdigit(), part3.isdigit()])
|
||||||
|
or not 0 <= int(part1) <= 255
|
||||||
if not 0 <= int(part1) <= 255:
|
or not 0 <= int(part2) <= 255
|
||||||
return False
|
or not 0 <= int(part3) <= 65535
|
||||||
|
):
|
||||||
if not 0 <= int(part2) <= 255:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if not 0 <= int(part3) <= 65535:
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user