def sethwaddr(self, ifindex, addr):
        ''' same as SimpleLxcNode.sethwaddr()
        '''
        self._netif[ifindex].sethwaddr(addr)
        ifname = self.ifname(ifindex)
        if self.up:
            (status, result) = self.cmdresult([IP_BIN, "link", "set", "dev",
                                              ifname, "address", str(addr)])
            if status:
                self.exception(coreapi.CORE_EXCP_LEVEL_ERROR,
                    "PhysicalNode.sethwaddr()",
                    "error setting MAC address %s" % str(addr))
dataset/ETHPy150Open coreemu/core/daemon/core/phys/pnodes.py/PhysicalNode.sethwaddr/original