Skip to content

Commit

Permalink
Fix logic error in call_is_plural() for access-rule vs. access-ruleba…
Browse files Browse the repository at this point in the history
…se, etc. (#155)
  • Loading branch information
duanetoler authored Nov 11, 2024
1 parent ffc1208 commit 9c00e11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plugins/module_utils/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,12 +1408,16 @@ def api_call_for_rule(module, api_call_object):

# check if call is in plural form
def call_is_plural(api_call_object, payload):
if payload.get("name") is not None or payload.get("rule-number") is not None and \
("nat" in api_call_object or "mobile-access" in api_call_object):
if (
(payload.get("name") is not None or payload.get("rule-number") is not None)
and ("nat" in api_call_object or "mobile-access" in api_call_object)
):
return False
if payload.get("layer") is None and \
("access" in api_call_object or "threat" in api_call_object or "https" in api_call_object):
return True
if (
payload.get("layer") is None
and ("access" in api_call_object or "threat" in api_call_object or "https" in api_call_object)
):
return True
return False


Expand Down

0 comments on commit 9c00e11

Please sign in to comment.