'Rename an interface (to its canonical name)'

def renameIntf(self, intf, newname=''):

    intf.ifconfig('down')
    if (not newname):
        newname = ('%s-eth%d' % (self.name, self.ports[intf]))
    intf.cmd('ip    link    set', intf, 'name', newname)
    del self.nameToIntf[intf.name]
    intf.name = newname
    self.nameToIntf[intf.name] = intf
    intf.ifconfig('up')
