Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pan os edit rule error without commit issue #28533

Merged
merged 13 commits into from Aug 2, 2023
5 changes: 3 additions & 2 deletions Packs/PAN-OS/Integrations/Panorama/Panorama.py
Expand Up @@ -3840,7 +3840,8 @@ def panorama_edit_rule_items(rulename: str, element_to_change: str, element_valu
else:
params["xpath"] = f'{params["xpath"]}/{element_to_change}'

current_objects_items = panorama_get_current_element(element_to_change, params['xpath'])
current_objects_items = panorama_get_current_element(element_to_change, params['xpath'],
is_commit_required=False)
if behaviour == 'add':
values = list((set(current_objects_items)).union(set(element_value))) # type: ignore[arg-type]
else: # remove
Expand Down Expand Up @@ -13397,7 +13398,7 @@ def pan_os_edit_tag(
comment (str): The tag comment.

Returns:
dict: The raw response from panorama's API.
dict: The raw response from panorama's API.
"""
params = {
'xpath': build_tag_xpath(name=tag_name),
Expand Down
3 changes: 1 addition & 2 deletions Packs/PAN-OS/Integrations/Panorama/Panorama_test.py
Expand Up @@ -1366,9 +1366,8 @@ def test_add_to_element_on_uncommited_rule(mocker, reset_device_group):
}
}
mocker.patch('Panorama.http_request', return_value=uncommited_rule_item)
Panorama.panorama_edit_rule_command(args)

with pytest.raises(DemistoException):
Panorama.panorama_edit_rule_command(args)

@staticmethod
def test_edit_rule_to_disabled_flow(mocker, reset_device_group):
Expand Down
6 changes: 6 additions & 0 deletions Packs/PAN-OS/ReleaseNotes/1_17_17.md
@@ -0,0 +1,6 @@

#### Integrations

##### Palo Alto Networks PAN-OS

- Fixed an issue where the **pan-os-edit-rule** command was not working in case the rule had changes which were not committed.
gal-forer marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Packs/PAN-OS/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "PAN-OS by Palo Alto Networks",
"description": "Manage Palo Alto Networks Firewall and Panorama. Use this pack to manage Prisma Access through Panorama. For more information see Panorama documentation.",
"support": "xsoar",
"currentVersion": "1.17.16",
"currentVersion": "1.17.17",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down