From 15e5737ef2df30f451a365d2aa2f4232b8c32f67 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 2 Jan 2021 11:54:32 +0100 Subject: ifconfig: ethernet: fixup line breaks --- python/vyos/ifconfig/ethernet.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'python') 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: -- cgit v1.2.3