aruba: add support for speed + duplex

This commit is contained in:
jeltz 2022-09-05 10:18:43 +02:00
parent c7e6a7bd50
commit b55d81d6cc
Signed by: jeltz
GPG key ID: 800882B66C0C3326
3 changed files with 19 additions and 1 deletions

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