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

fix: Fixes refresh() for attrib style params #395

Merged
merged 2 commits into from
Jan 27, 2022
Merged

fix: Fixes refresh() for attrib style params #395

merged 2 commits into from
Jan 27, 2022

Conversation

shinmog
Copy link
Collaborator

@shinmog shinmog commented Jan 6, 2022

This fixes "attrib" style params, which are (currently) only present in
the various rule objects in policies.py.

Doing rule.apply() when the uuid is set and the name is unchanged
does not cause PAN-OS to complain, so this fix does not cause any
regressions / change in standard behavior.

Doing `rule.apply() when the uuid is set and the name IS changed
causes PAN-OS to silently create another rule with a new uuid. This
of course means that the uuid of the object that was applied differs
between the user's object hierarchy and what's on live.

In light of this, we might want to investigate how to handle changing the
unique identifier from the name to the uuid of the rule, but some research
is needed on if this is actually possible from an XPATH perspective as well
as how to gracefully handle backwards compatibility (before the uuid field existed).

Fixes #392

This fixes "attrib" style params, which are (currently) only present in
the various rule objects in policies.py.

Doing `rule.apply()` when the uuid is set and the name is unchanged
does not cause PAN-OS to complain, so this fix does not cause any
regressions / change in standard behavior.

Doing `rule.apply() when the uuid is set and the name IS changed
causes PAN-OS to silently create another rule with a new uuid.  This
of course means that the uuid of the object that was applied differs
between the user's object hierarchy and what's on live.

In light of this, we might want to investigate how to handle changing the
unique identifier from the name to the uuid of the rule, but some research
is needed on if this is actually possible from an XPATH perspective as well
as how to gracefully handle backwards compatibility (before the uuid field existed).

Fixes #392
@shinmog shinmog requested a review from btorresgil January 6, 2022 23:21
@shinmog shinmog merged commit 0b47a3a into develop Jan 27, 2022
@shinmog shinmog deleted the fix/392 branch January 27, 2022 17:37
github-actions bot pushed a commit that referenced this pull request Mar 29, 2022
## [1.7.0](v1.6.0...v1.7.0) (2022-03-29)

### Features

*  Add Prisma Access support ([#419](#419)) ([f93416e](f93416e)), closes [#406](#406) [#413](#413) [#396](#396)
* Add decryption rule target and negate_target ([#404](#404)) ([88a2903](88a2903))
* Add hierarchy retrieval info ([#366](#366)) ([a290b31](a290b31))
* Add hit count support for Panorama / device group rulebases ([#429](#429)) ([057822a](057822a)), closes [#388](#388)
* **panos.panorama.Panorama:** Add `refresh_shared_objects()` ([#436](#436)) ([11327a4](11327a4)), closes [#428](#428)
* Add alternative quoting for `op()` ([#367](#367)) ([b8d0379](b8d0379)), closes [#234](#234)
* Add Cloud Services plugin support ([683f3b5](683f3b5))
* Add Local User Database objects ([#385](#385)) ([d39b6de](d39b6de))
* Add objects.ApplicationOverride ([#405](#405)) ([98db86a](98db86a))
* Add policies.AuthenticationRule ([#415](#415)) ([0d70d3f](0d70d3f))
* ApplicationTag - tag predefined applications ([#414](#414)) ([cfee6e3](cfee6e3))
* Make opstate more discoverable for users ([#413](#413)) ([f4f08d0](f4f08d0)), closes [#396](#396)

### Bug Fixes

* **panos.objects.ApplicationFilter:** Fix tag path  ([#381](#381)) ([a0991f8](a0991f8))
* `delete_similar()` now breaks delete calls into chunks ([#435](#435)) ([4333377](4333377))
* Fixes `refresh()` for attrib style params ([#395](#395)) ([0b47a3a](0b47a3a)), closes [#392](#392)
* Modify show_highavailability_state method xpath for Panorama ([#430](#430)) ([37ed2ca](37ed2ca))
* **AggregateInterface:** Correct lacp_passive_pre_negotiation xpath ([6a67320](6a67320)), closes [#406](#406)
@github-actions
Copy link

🎉 This PR is included in version 1.7.0 🎉

The release is available on PyPI and GitHub release

Posted by semantic-release bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UUID attribute in SecurityRule returns None
1 participant