Only allow ethernet and wi-fi interfaces as unique ID in webmin (#113084)

This commit is contained in:
Sid 2024-05-16 12:16:13 +02:00 committed by GitHub
parent e6f5b08264
commit 9d10e42d79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,5 +43,7 @@ def get_instance_from_options(
def get_sorted_mac_addresses(data: dict[str, Any]) -> list[str]:
"""Return a sorted list of mac addresses."""
return sorted(
[iface["ether"] for iface in data["active_interfaces"] if "ether" in iface]
iface["ether"]
for iface in data["active_interfaces"]
if "ether" in iface and iface["name"].startswith(("en", "eth", "wl"))
)