Skip to content

Commit 9c00e11

Browse files
authored
Fix logic error in call_is_plural() for access-rule vs. access-rulebase, etc. (#155)
1 parent ffc1208 commit 9c00e11

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

plugins/module_utils/checkpoint.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,12 +1408,16 @@ def api_call_for_rule(module, api_call_object):
14081408

14091409
# check if call is in plural form
14101410
def call_is_plural(api_call_object, payload):
1411-
if payload.get("name") is not None or payload.get("rule-number") is not None and \
1412-
("nat" in api_call_object or "mobile-access" in api_call_object):
1411+
if (
1412+
(payload.get("name") is not None or payload.get("rule-number") is not None)
1413+
and ("nat" in api_call_object or "mobile-access" in api_call_object)
1414+
):
14131415
return False
1414-
if payload.get("layer") is None and \
1415-
("access" in api_call_object or "threat" in api_call_object or "https" in api_call_object):
1416-
return True
1416+
if (
1417+
payload.get("layer") is None
1418+
and ("access" in api_call_object or "threat" in api_call_object or "https" in api_call_object)
1419+
):
1420+
return True
14171421
return False
14181422

14191423

0 commit comments

Comments
 (0)