summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-07 14:14:57 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-07 14:14:57 +0200
commitcceffc8725271b15107f21ae26f4e477751df6bc (patch)
treef7c14576edf87f88a50346a7578900ce25e39bb4 /src
parentd70f1538f215f065855a89b1afe4cd8b26cd9cc2 (diff)
downloadvyos-1x-cceffc8725271b15107f21ae26f4e477751df6bc.tar.gz
vyos-1x-cceffc8725271b15107f21ae26f4e477751df6bc.zip
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
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-wirelessmodem.py31
1 files changed, 5 insertions, 26 deletions
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