pan-os-python icon indicating copy to clipboard operation
pan-os-python copied to clipboard

Rename overridden address object issue

Open chrisgoodwins opened this issue 5 years ago • 3 comments

Describe the bug

The issue occurs when using the rename method to rename an address object that is overridden from a parent device group object (it has the same name). Any reference to the parent DG object in a parent DG address groups gets renamed, causing the config to fail validation.

Expected behavior

The parent DG address group references should not be renamed, they should remain unchanged.

Steps to reproduce

pan_device = Panorama('10.10.10.10', 'username', 'password') pan_device.add(DeviceGroup('TestDG1')).refresh() addr_obj = pan_device.children[0].find('server15', AddressObject) addr_obj.rename(f'TEST123_{addr_obj.name}')

Screenshots

For some reason this form isn't letting me upload screenshots :( I'll try and upload screenshots after submitting this form

Your Environment

  • Version used:
  • python 3.8.1
  • Windows 10
  • Latest version of pandevice and pan-python

chrisgoodwins avatar Jun 06 '20 18:06 chrisgoodwins

Screenshots of before rename... https://drive.google.com/file/d/1UJfLoFdqFCVv_b_nvHNs-pbjf0K9DI6h/view

And after rename... https://drive.google.com/file/d/1Awx4AZQQJcfbaJ1OjVTkS1D7-q9-vMka/view

chrisgoodwins avatar Jun 06 '20 18:06 chrisgoodwins

Hello! I've looked into this issue since you opened it, and it sounds to me like this is an issue in the PAN-OS API. The .rename() method only calls the 'rename' action in the PAN-OS API, and it doesn't apply any extra logic to that API call. So it's PAN-OS that is deciding what to rename in the configuration XML when that rename API call is made.

My suggestion is to open a TAC case to investigate. The PAN-OS API is fully supported by Palo Alto Networks TAC, so any issues with the API would become an official bug report sent to the engineering team.

Please let me know if this addresses your concern or if there's anything we can do on the pandevice library side. If you need any help getting traction in the TAC case, feel free to reach out to me: [email protected]

btorresgil avatar Jun 11 '20 16:06 btorresgil

Ok thanks, I've confirmed your findings as well, and will open a case with TAC.

chrisgoodwins avatar Jun 14 '20 01:06 chrisgoodwins