Skip to content

Commit 0bf0f28

Browse files
authored
fix python 2.7 syntax error (#111)
1 parent b417d34 commit 0bf0f28

File tree

5 files changed

+36
-7
lines changed

5 files changed

+36
-7
lines changed

CHANGELOG.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Check_Point.Mgmt Release Notes
55
.. contents:: Topics
66

77

8+
v5.1.1
9+
======
10+
11+
Release Summary
12+
---------------
13+
14+
This is release 5.1.1 of ``check_point.mgmt``, released on 2023-05-25.
15+
16+
Bugfixes
17+
--------
18+
19+
- module_utils/checkpoint.py - fixed compile issue (Syntax Error) on python 2.7
20+
821
v5.1.0
922
======
1023

changelogs/.plugin-cache.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ plugins:
14571457
shell: {}
14581458
strategy: {}
14591459
vars: {}
1460-
version: 5.1.0
1460+
version: 5.1.1

changelogs/changelog.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,3 +1025,13 @@ releases:
10251025
fragments:
10261026
- 5.1.0.yml
10271027
release_date: '2022-07-16'
1028+
5.1.1:
1029+
changes:
1030+
bugfixes:
1031+
- module_utils/checkpoint.py - fixed compile issue (Syntax Error) on python
1032+
2.7
1033+
release_summary: This is release 5.1.1 of ``check_point.mgmt``, released on
1034+
2023-05-25.
1035+
fragments:
1036+
- 5.1.1.yml
1037+
release_date: '2022-07-17'

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace: check_point
99
name: mgmt
1010

1111
# The version of the collection. Must be compatible with semantic versioning
12-
version: 5.1.0
12+
version: 5.1.1
1313

1414
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1515
readme: README.md

plugins/module_utils/checkpoint.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,10 @@ def get_rulebase_generator(
686686
limit = 100
687687
while True:
688688
payload_for_show_rulebase = {
689-
**show_rulebase_identifier_payload,
690689
"limit": limit,
691690
"offset": offset,
692691
}
692+
payload_for_show_rulebase.update(show_rulebase_identifier_payload)
693693
# in case there are empty sections after the last rule, we need them to appear in the reply and the limit might
694694
# cut them out
695695
if offset + limit >= rules_amount:
@@ -733,11 +733,13 @@ def get_edge_position_in_section(
733733

734734
# return the total amount of rules in the rulebase of the given layer
735735
def get_rules_amount(connection, version, show_rulebase_payload, show_rulebase_command):
736+
payload = {"limit": 0}
737+
payload.update(show_rulebase_payload)
736738
code, response = send_request(
737739
connection,
738740
version,
739741
show_rulebase_command,
740-
{**show_rulebase_payload, "limit": 0},
742+
payload,
741743
)
742744
return int(response["total"])
743745

@@ -764,11 +766,13 @@ def relative_position_is_section(
764766

765767
show_section_command = "show-access-section" if 'access' in api_call_object else "show-nat-section"
766768
relative_position_value = list(relative_position.values())[0]
769+
payload = {"name": relative_position_value}
770+
payload.update(layer_or_package_payload)
767771
code, response = send_request(
768772
connection,
769773
version,
770774
show_section_command,
771-
{**layer_or_package_payload, "name": relative_position_value},
775+
payload,
772776
)
773777
if code == 200:
774778
return True
@@ -1010,11 +1014,12 @@ def get_number_and_section_from_position(
10101014
show_rulebase_payload,
10111015
show_rulebase_command,
10121016
)
1017+
show_rulebase_payload.update({"offset": position - 1})
10131018
code, response = send_request(
10141019
connection,
10151020
version,
10161021
show_rulebase_command,
1017-
{**show_rulebase_payload, "offset": position - 1},
1022+
show_rulebase_payload,
10181023
)
10191024
rulebase = reversed(response["rulebase"])
10201025
else: # is a number so we need to get the section (if exists) of the rule in that position
@@ -1136,7 +1141,8 @@ def get_number_and_section_from_position(
11361141
# build the show rulebase payload
11371142
def build_rulebase_payload(api_call_object, payload, position_number):
11381143
show_rulebase_required_identifiers_payload = get_relevant_show_rulebase_identifier_payload(api_call_object, payload)
1139-
return {**show_rulebase_required_identifiers_payload, 'offset': position_number - 1, 'limit': 1}
1144+
show_rulebase_required_identifiers_payload.update({'offset': position_number - 1, 'limit': 1})
1145+
return show_rulebase_required_identifiers_payload
11401146

11411147

11421148
def build_rulebase_command(api_call_object):

0 commit comments

Comments
 (0)