panos_util/policies.py
def create_from_element(e: Element) -> SecurityRule:
        """Create SecurityRule from XML element."""
        name = e.get("name")
        action = strip_empty(e.findtext("action"))

        disabled = strip_empty(e.findtext("disabled"))
        if disabled == "yes":
            disabled = True
        else:
            disabled = False

        security_profile_group = strip_empty(
            e.findtext(".//profile-setting/group/member")
        )
        vulnerability_profile = strip_empty(
            e.findtext(".//profile-setting/profiles/vulnerability/member")
        )

        return SecurityRule(
            name, action, disabled, security_profile_group, vulnerability_profile
        )
Create SecurityRule from XML element.
Create SecurityRule from XML element.
Create SecurityRule from XML element .
def create_from_element(e: Element) -> SecurityRule:
        name = e.get("name")
        action = strip_empty(e.findtext("action"))
        disabled = strip_empty(e.findtext("disabled"))
        if disabled == "yes":
            disabled = True
        else:
            disabled = False
        security_profile_group = strip_empty(
            e.findtext(".//profile-setting/group/member")
        )
        vulnerability_profile = strip_empty(
            e.findtext(".//profile-setting/profiles/vulnerability/member")
        )
        return SecurityRule(
            name, action, disabled, security_profile_group, vulnerability_profile
        )
def create_from_element ( e : Element ) -> SecurityRule : name = e . get ( "name" ) action = strip_empty ( e . findtext ( "action" ) ) disabled = strip_empty ( e . findtext ( "disabled" ) ) if disabled == "yes" : disabled = True else : disabled = False security_profile_group = strip_empty ( e . findtext ( ".//profile-setting/group/member" ) ) vulnerability_profile = strip_empty ( e . findtext ( ".//profile-setting/profiles/vulnerability/member" ) ) return SecurityRule ( name , action , disabled , security_profile_group , vulnerability_profile )
Create SecurityRule from XML element.
Create SecurityRule from XML element .
"""Create SecurityRule from XML element."""
e
Element