summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wirelessmodem.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-08-15 20:28:34 +0200
committerChristian Poessinger <christian@poessinger.com>2020-08-15 20:28:34 +0200
commita8f5cc26273e561bb4d4df088f13e7b6023dad5e (patch)
tree37a43b59ff7bf26331e552e89b803799391a26e8 /src/conf_mode/interfaces-wirelessmodem.py
parent1e44607c15002e111bf65573207877cc87f13ab7 (diff)
parentb082a6fb211ef19d75c4c81414be9aa1b9248b45 (diff)
downloadvyos-1x-a8f5cc26273e561bb4d4df088f13e7b6023dad5e.tar.gz
vyos-1x-a8f5cc26273e561bb4d4df088f13e7b6023dad5e.zip
Merge branch 't2564-lcd' of github.com:c-po/vyos-1x into current
* 't2564-lcd' of github.com:c-po/vyos-1x: lcd: T2564: flatten CLI interface system display: T2564: Added test model system display: T2564: Dictionary code update system display: T2564: Conf files to /run system display: T2564: Changed "duration" to "time" system display: T2564: py code cleanup system display: T2564: Replace "config (enabled|disabled)" with "display disabled" system display: T2564: Lowercase model names system display: T2564 Extend VyOS to support appliance LCDs
Diffstat (limited to 'src/conf_mode/interfaces-wirelessmodem.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wirelessmodem.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py
index 4081be3c9..6d168d918 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -16,7 +16,6 @@
import os
-from fnmatch import fnmatch
from sys import exit
from vyos.config import Config
@@ -25,22 +24,13 @@ from vyos.configverify import verify_vrf
from vyos.template import render
from vyos.util import call
from vyos.util import check_kmod
+from vyos.util import find_device_file
from vyos import ConfigError
from vyos import airbag
airbag.enable()
k_mod = ['option', 'usb_wwan', 'usbserial']
-def find_device_file(device):
- """ Recurively search /dev for the given device file and return its full path.
- If no device file was found 'None' is returned """
- for root, dirs, files in os.walk('/dev'):
- for basename in files:
- if fnmatch(basename, device):
- return os.path.join(root, basename)
-
- return None
-
def get_config():
"""
Retrive CLI config as dictionary. Dictionary can never be empty, as at least the