From cceffc8725271b15107f21ae26f4e477751df6bc Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Jun 2020 14:14:57 +0200 Subject: wwan: T2241: interface is not bond- or bridgeable Commit 2cb806271928 ("wirelessmodem: T2241: make VRF and bond/bridge membership mutually exclusive") added some logic which is not forseen/neither makes sense on a dialup interface, thus it's removed again --- src/conf_mode/interfaces-wirelessmodem.py | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 571969f4d..c05ca684e 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -32,7 +32,6 @@ from vyos import airbag airbag.enable() default_config_data = { - 'address': [], 'apn': '', 'chat_script': '', 'deleted': False, @@ -77,9 +76,6 @@ def get_config(): wwan['intf'] = os.environ['VYOS_TAGNODE_VALUE'] wwan['chat_script'] = f"/etc/ppp/peers/chat.{wwan['intf']}" - # check if interface is member if a bridge - wwan['is_bridge_member'] = is_member(conf, wwan['intf'], 'bridge') - # Check if interface has been removed if not conf.exists('interfaces wirelessmodem ' + wwan['intf']): wwan['deleted'] = True @@ -138,11 +134,6 @@ def get_config(): def verify(wwan): if wwan['deleted']: - if wwan['is_bridge_member']: - raise ConfigError(( - f'Cannot delete interface "{wwan["intf"]}" as it is a ' - f'member of bridge "{wwan["is_bridge_member"]}"!')) - return None if not wwan['apn']: @@ -153,23 +144,11 @@ def verify(wwan): # we can not use isfile() here as Linux device files are no regular files # thus the check will return False - if not os.path.exists(f"/dev/{wwan['device']}"): - raise ConfigError(f"Device {wwan['device']} does not exist") - - if wwan['is_bridge_member'] and wwan['address']: - raise ConfigError(( - f'Cannot assign address to interface "{wwan["intf"]}" ' - f'as it is a member of bridge "{wwan["is_bridge_member"]}"!')) - - if wwan['vrf']: - if wwan['vrf'] not in interfaces(): - raise ConfigError(f'VRF "{wwan["vrf"]}" does not exist') - - if wwan['is_bridge_member']: - raise ConfigError(( - f'Interface "{wwan["intf"]}" cannot be member of VRF ' - f'"{wwan["vrf"]}" and bridge {wwan["is_bridge_member"]} ' - f'at the same time!')) + if not os.path.exists('{device}'.format(**wwan)): + raise ConfigError('Device "{device}" does not exist'.format(**wwan)) + + if wwan['vrf'] not in interfaces(): + raise ConfigError('VRF "{vrf}" does not exist'.format(**wwan)) return None -- cgit v1.2.3