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

Using the predefined object like an object does not work

Open shinmog opened this issue 4 years ago • 1 comments

Describe the bug

This doesn't work and should:

from panos.firewall import Firewall
from panos.predefined import Predefined
from panos.objects import ServiceObject

fw = Firewall(.....)
predef = Predefined()
fw.add(predef)
ServiceObject.refreshall(predef)

shinmog avatar Oct 27 '21 16:10 shinmog

Are you able to use the Predefined object that gets instantiated as a member of the Firewall object? From the documentation: "This class is typically not instantiated by anything but the base.PanDevice class itself. There is an instance of this Predefined class inside every instantiated base.PanDevice class."

You should be able to refresh services by doing:

from panos.firewall import Firewall

fw = Firewall( ... )
fw.predefined.refreshall_services()

banachtarski-91 avatar Feb 20 '22 15:02 banachtarski-91