pan-os-python
pan-os-python copied to clipboard
Setting address object failed on PA-3260 (v8.1.4.H2) while succeeded on PA-3000 (v8.1.2)
Synopsis: Setting address object failed on PA-3260 (v8.1.4.H2) while succeeded on PA-3000 (v8.1.2)
Exception: vsys1 -> address has unexpected text.
Python package: pan-python=0.13.0 pandevice=0.6.6
Code snippet (sample):
fw = pandevice.firewall.Firewall('10.0.0.1', 'username', 'password', port='443')
bulk_objects = []
ao = pandevice.objects.AddressObject(
name='test',
value='10.0.0.2/32',
type='ip-netmask')
bulk_objects.append(ao)
fw.add(ao)
bulk_objects[0].create_similar()
bulk_objects[0].apply_similar()
The error you're getting is coming from the firewall, so something is not conforming to the firewall's configuration requirements.
You shouldn't need to do a create_similar()
and apply_similar()
. Just one or the other. Does it help to remove one of them? Try just create()
or create_similar()
.
Also, note that since you instantiate only one address object, doing an apply_similar()
would wipe out any address objects already on the device. Make sure that's your intention.
I tested this on 8.1.3 and it works. I'll try to test on 8.1.4 soon, but I doubt it's a version-related problem. More likely it's configuration related.
@btorresgil Thanks for your prompt reply and suggestion.
- In my production code, I do need to wipe out any address objects already on the device.
- The version at hand is 8.1.4.H2 instead of 8.1.4. Does it matter?