summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wirelessmodem.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/interfaces-wirelessmodem.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wirelessmodem.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py
index 9efad3b8d..76ed90daa 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -84,7 +84,8 @@ default_config_data = {
'metric': '10',
'mtu': '1500',
'name_server': True,
- 'intf': ''
+ 'intf': '',
+ 'vrf': ''
}
def subprocess_cmd(command):
@@ -154,6 +155,10 @@ def get_config():
if conf.exists(['ondemand']):
wwan['on_demand'] = True
+ # retrieve VRF instance
+ if conf.exists('vrf'):
+ wwan['vrf'] = conf.return_value(['vrf'])
+
return wwan
def verify(wwan):
@@ -168,6 +173,10 @@ def verify(wwan):
if not os.path.exists(f"/dev/{wwan['device']}"):
raise ConfigError(f"Device {wwan['device']} does not exist")
+ vrf_name = wwan['vrf']
+ if vrf_name and vrf_name not in interfaces():
+ raise ConfigError(f'VRF {vrf_name} does not exist')
+
return None
def generate(wwan):