aruba: add support for speed + duplex

pull/103/head
jeltz 2 years ago
parent c7e6a7bd50
commit b55d81d6cc
Signed by: jeltz
GPG Key ID: 800882B66C0C3326

@ -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

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

@ -148,6 +148,12 @@ interface {{ id | int }}
enable
{% else %}
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 %}
exit

Loading…
Cancel
Save