pan-os-python
pan-os-python copied to clipboard
Rename overridden address object issue
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
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
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]
Ok thanks, I've confirmed your findings as well, and will open a case with TAC.