

def set_lacp_mode(self, name, mode):
    "Configures the LACP mode of the member interfaces\n\n        Args:\n            name(str): The Port-Channel interface name to configure the\n                LACP mode\n\n            mode(str): The LACP mode to configure the member interfaces to.\n                Valid values are 'on, 'passive', 'active'\n\n        Returns:\n            True if the operation succeeds otherwise False\n        "
    if (mode not in ['on', 'passive', 'active']):
        return False
    grpid = re.search('(\\d+)', name).group()
    remove_commands = list()
    add_commands = list()
    for member in self.get_members(name):
        remove_commands.append(('interface %s' % member))
        remove_commands.append(('no channel-group %s' % grpid))
        add_commands.append(('interface %s' % member))
        add_commands.append(('channel-group %s mode %s' % (grpid, mode)))
    return self.configure((remove_commands + add_commands))

dataset/ETHPy150Open arista-eosplus/pyeapi/pyeapi/api/interfaces.py PortchannelInterface.set_lacp_mode/original