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

result["before"] includes newly added items for list type params #573

Open
alperenkose opened this issue Aug 8, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@alperenkose
Copy link
Collaborator

Describe the bug

result["before"] includes newly added items when updating a list type param. Issue seen on panos_security_rule but possibly exists on others as well.

Consider the following scenario:

Existing security rule only have "192.168.8.0/24" in source_ip.

Following request is made to add additional address to the list of source_ip.

- name: "merged state update"
  paloaltonetworks.panos.panos_security_rule:
    provider: "{{ device }}"
    state: merged
    device_group: "lab1-ha-dg"
    rulebase: "post-rulebase"
    rule_name: "rule-with-defaults"
    source_ip: ["10.0.0.0/8"]
    source_zone: ["private"]

In result["before"] it looks like following, whereas it looks correct in result["diff"]["before"] with "192.168.8.0/24" only;

    "source_ip": [
        "192.168.8.0/24",
        "10.0.0.0/8"
    ],

Expected behavior

result["before"] should return existing configuration, not merged configuration for list type params.

Possible solution

It looks like we need a fix in describe() method to return with a deep-copied list as nested list in the object might be the issue..

@alperenkose alperenkose added the bug Something isn't working label Aug 8, 2024
@alperenkose alperenkose self-assigned this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant