summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-02 11:54:32 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-02 11:54:32 +0100
commit15e5737ef2df30f451a365d2aa2f4232b8c32f67 (patch)
tree13fd27afeebcd0975d45146c355918d38da27a42 /python/vyos
parentb13235d2b2a186be059690af88b243b33b37d60f (diff)
downloadvyos-1x-15e5737ef2df30f451a365d2aa2f4232b8c32f67.tar.gz
vyos-1x-15e5737ef2df30f451a365d2aa2f4232b8c32f67.zip
ifconfig: ethernet: fixup line breaks
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/ifconfig/ethernet.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index 7cf79bead..795218f32 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -118,9 +118,10 @@ class EthernetIf(Interface):
if enable not in ['on', 'off']:
raise ValueError("Value out of range")
- if self.get_driver_name() in ['vmxnet3', 'virtio_net', 'xen_netfront']:
- self._debug_msg('{} driver does not support changing flow control settings!'
- .format(self.get_driver_name()))
+ driver_name = self.get_driver_name()
+ if driver_name in ['vmxnet3', 'virtio_net', 'xen_netfront']:
+ self._debug_msg(f'{driver_name} driver does not support changing '\
+ 'flow control settings!')
return
# Get current flow control settings:
@@ -169,15 +170,17 @@ class EthernetIf(Interface):
>>> i.set_speed_duplex('auto', 'auto')
"""
- if speed not in ['auto', '10', '100', '1000', '2500', '5000', '10000', '25000', '40000', '50000', '100000', '400000']:
+ if speed not in ['auto', '10', '100', '1000', '2500', '5000', '10000',
+ '25000', '40000', '50000', '100000', '400000']:
raise ValueError("Value out of range (speed)")
if duplex not in ['auto', 'full', 'half']:
raise ValueError("Value out of range (duplex)")
- if self.get_driver_name() in ['vmxnet3', 'virtio_net', 'xen_netfront']:
- self._debug_msg('{} driver does not support changing speed/duplex settings!'
- .format(self.get_driver_name()))
+ driver_name = self.get_driver_name()
+ if driver_name in ['vmxnet3', 'virtio_net', 'xen_netfront']:
+ self._debug_msg(f'{driver_name} driver does not support changing '\
+ 'speed/duplex settings!')
return
# Get current speed and duplex settings: