def newnetif(self, net = None, addrlist = [], hwaddr = None,
                 ifindex = None, ifname = None):
        if self.up and net is None:
            raise NotImplementedError
        if ifindex is None:
            ifindex = self.newifindex()

        if self.up:
            # this is reached when this node is linked to a network node
            # tunnel to net not built yet, so build it now and adopt it
            gt = self.session.broker.addnettunnel(net.objid)
            if gt is None or len(gt) != 1:
                self.session.warn("Error building tunnel from PhysicalNode."
                                  "newnetif()")
            gt = gt[0]
            net.detach(gt)
            self.adoptnetif(gt, ifindex, hwaddr, addrlist)
            return ifindex
            
        # this is reached when configuring services (self.up=False)
        if ifname is None:
            ifname = ifindex % "gt%d"
        netif = GreTap(node = self, name = ifname, session = self.session,
                       start = False)
        self.adoptnetif(netif, ifindex, hwaddr, addrlist)
        return ifindex
dataset/ETHPy150Open coreemu/core/daemon/core/phys/pnodes.py/PhysicalNode.newnetif/swapped operands of `%`