summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wirelessmodem.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-10 19:50:00 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-28 20:48:32 +0100
commitced45949bc282d23b0767f698f31b580602f0c9c (patch)
treefe42a9b240c3cf4c642f4975df358ffbff36aa83 /src/conf_mode/interfaces-wirelessmodem.py
parentbf628f732acedce1ff1837202627260c6fd4533d (diff)
downloadvyos-1x-ced45949bc282d23b0767f698f31b580602f0c9c.tar.gz
vyos-1x-ced45949bc282d23b0767f698f31b580602f0c9c.zip
wwan: T1988: add support for Sierra Wireless MC7710 modem
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 388d98f4e..93f60d038 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -32,6 +32,9 @@ config_wwan_tmpl = """### Autogenerated by interfaces-wirelessmodem.py ###
# {{ description }}
{% endif %}
+# physical device
+/dev/{{ device }}
+
ipparam {{ intf }} {{ metric }}
{% if on_demand -%}
demand
@@ -53,6 +56,7 @@ crtscts
lock
persist
+
"""
default_config_data = {
@@ -136,9 +140,14 @@ def get_config():
return wwan
def verify(wwan):
- if wwan is None:
+ if wwan['deleted']:
return None
+ # 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")
+
return None
def generate(wwan):