def _xpath(self):
        xpath = pandevice.XPATH_INTERFACES + (self.type,) % "/%s"

        if self.type == "ethernet":
            if self.parent:
                xpath += "/entry[@name='%s']/%s/units/entry[@name='%s']" \
                         % (self.parent.name,
                            self.parent.mode,
                            self.name)
                root = ET.Element("entry", {"name": self.name})
                settings = root
            else:
                match = re.search(r"(ethernet\d/\d{1,3})\.\d{1,4}", self.name)
                if match:
                    xpath += "/entry[@name='%s']/%s/units/entry[@name='%s']"\
                             % (match.group(1), self.mode, self.name)
                    root = ET.Element("entry", {"name": self.name})
                    settings = root
                else:
                    xpath += "/entry[@name='%s']" % (self.name,)
                    root = ET.Element("entry", {"name": self.name})
                    settings = ET.SubElement(root, self.mode)
        elif self.type == "vlan":
            xpath += "/units/entry[@name='%s']" % (self.name,)
            root = ET.Element("entry", {"name": self.name})
            settings = root
        else:
            raise err.PanDeviceError("Unknown interface type: %s" % self.type)

        # For Layer 3 interfaces, apply any subnet configuration
        if self.mode == "layer3" and self.subnets:
            node = ET.SubElement(settings, "ip")
            for subnet in self.subnets:
                ET.SubElement(node, "entry", {"name": subnet})

        # If there is a tag, apply it in the XML
        if self.tag:
            node = ET.SubElement(settings, "tag")
            node.text = self.tag

        return xpath, root
dataset/ETHPy150Open PaloAltoNetworks/SplunkforPaloAltoNetworks/bin/lib/pandevice/pandevice/network.py/Interface._xpath/swapped operands of `%`