summaryrefslogtreecommitdiff
path: root/python/vyos/ethtool.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-10 16:56:32 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-10 17:01:33 +0200
commite626407f4c246941eb2ca1b167a4b594b7bf6461 (patch)
tree58420da9fe8c456eb1ee650272bc3b135c893ddc /python/vyos/ethtool.py
parent7a264d9e17bd918c33879ba5cd70b00bb786726a (diff)
downloadvyos-1x-e626407f4c246941eb2ca1b167a4b594b7bf6461.tar.gz
vyos-1x-e626407f4c246941eb2ca1b167a4b594b7bf6461.zip
ethtool: T3802: extend check_speed_duplex() implementation to support 'auto'
(cherry picked from commit 3037661951d0e5d1f6264f886781b7ddc019329e)
Diffstat (limited to 'python/vyos/ethtool.py')
-rw-r--r--python/vyos/ethtool.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/ethtool.py b/python/vyos/ethtool.py
index 4efc3a234..bc95767b1 100644
--- a/python/vyos/ethtool.py
+++ b/python/vyos/ethtool.py
@@ -190,9 +190,9 @@ class Ethtool:
the underlaying network adapter. """
if isinstance(speed, int):
speed = str(speed)
- if not speed.isdigit():
+ if speed != 'auto' and not speed.isdigit():
raise ValueError(f'Value "{speed}" for speed is invalid!')
- if duplex not in ['full', 'half']:
+ if duplex not in ['auto', 'full', 'half']:
raise ValueError(f'Value "{duplex}" for duplex is invalid!')
if self.get_driver_name() in ['vmxnet3', 'virtio_net', 'xen_netfront']: