|
|
@ -199,15 +199,15 @@ class Lacp_interfaces(ConfigBase):
|
|
|
|
|
|
|
|
|
|
|
|
def generate_commands(interface, to_set, to_remove):
|
|
|
|
def generate_commands(interface, to_set, to_remove):
|
|
|
|
commands = []
|
|
|
|
commands = []
|
|
|
|
|
|
|
|
for key in to_remove.keys():
|
|
|
|
|
|
|
|
commands.append("no lacp {0}".format(key.replace("_", "-")))
|
|
|
|
|
|
|
|
|
|
|
|
for key, value in to_set.items():
|
|
|
|
for key, value in to_set.items():
|
|
|
|
if value is None:
|
|
|
|
if value is None:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
commands.append("lacp {0} {1}".format(key.replace("_", "-"), value))
|
|
|
|
commands.append("lacp {0} {1}".format(key.replace("_", "-"), value))
|
|
|
|
|
|
|
|
|
|
|
|
for key in to_remove.keys():
|
|
|
|
|
|
|
|
commands.append("no lacp {0}".format(key.replace("_", "-")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if commands:
|
|
|
|
if commands:
|
|
|
|
commands.insert(0, "interface {0}".format(interface))
|
|
|
|
commands.insert(0, "interface {0}".format(interface))
|
|
|
|
|
|
|
|
|
|
|
|