Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible FreeIPA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Ansible FreeIPA
Commits
2545f970
Commit
2545f970
authored
Apr 29, 2021
by
Rafael Guterres Jeffman
Browse files
Options
Downloads
Patches
Plain Diff
Fix excessive number of returns.
parent
95cdd43a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/module_utils/ansible_freeipa_module.py
+1
-9
1 addition, 9 deletions
plugins/module_utils/ansible_freeipa_module.py
plugins/modules/ipadnszone.py
+6
-10
6 additions, 10 deletions
plugins/modules/ipadnszone.py
with
7 additions
and
19 deletions
plugins/module_utils/ansible_freeipa_module.py
+
1
−
9
View file @
2545f970
...
...
@@ -294,16 +294,8 @@ else:
# If both args and ipa are None, return there's no difference.
# If only one is None, return there is a difference.
# 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
:
module
.
debug
(
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
return
args
is
None
and
ipa
is
None
# Fail if args or ipa are not dicts.
if
not
(
isinstance
(
args
,
dict
)
and
isinstance
(
ipa
,
dict
)):
...
...
This diff is collapsed.
Click to expand it.
plugins/modules/ipadnszone.py
+
6
−
10
View file @
2545f970
...
...
@@ -269,16 +269,12 @@ class DNSZoneModule(FreeIPABaseModule):
except
ValueError
:
return
False
if
not
all
([
part1
.
isdigit
(),
part2
.
isdigit
(),
part3
.
isdigit
()]):
return
False
if
not
0
<=
int
(
part1
)
<=
255
:
return
False
if
not
0
<=
int
(
part2
)
<=
255
:
return
False
if
not
0
<=
int
(
part3
)
<=
65535
:
if
(
not
all
([
part1
.
isdigit
(),
part2
.
isdigit
(),
part3
.
isdigit
()])
or
not
0
<=
int
(
part1
)
<=
255
or
not
0
<=
int
(
part2
)
<=
255
or
not
0
<=
int
(
part3
)
<=
65535
):
return
False
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment