WIP: Aruba switches #103

Draft
jeltz wants to merge 10 commits from aruba into master
3 changed files with 19 additions and 1 deletions
Showing only changes of commit b55d81d6cc - Show all commits

View file

@ -0,0 +1,11 @@
class FilterModule:
def filters(self):
return {
"choices": choices,
}
def choices(value, choices):
if value not in choices:
raise ValueError(f"{value} not in {choices}")
return value

View file

@ -59,7 +59,8 @@
4: 4:
name: "Client 2" name: "Client 2"
untagged: 1002 untagged: 1002
speed: 100fdx speed: 1000
duplex: half
loop_protect: true loop_protect: true
5: 5:
name: "Client 3" name: "Client 3"

View file

@ -148,6 +148,12 @@ interface {{ id | int }}
enable enable
{% else %} {% else %}
no enable no enable
{% endif %}
{% if iface.speed is defined %}
speed {{ iface.speed | int | choices([10, 100, 1000]) }}
{% endif %}
{% if iface.duplex is defined %}
duplex {{ iface.duplex | choices(["full", "half", "auto"]) }}
{% endif %} {% endif %}
exit exit