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.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py
index 7d8110096..bce3405d0 100755
--- a/src/conf_mode/interfaces-wirelessmodem.py
+++ b/src/conf_mode/interfaces-wirelessmodem.py
@@ -42,6 +42,7 @@ def get_config(config=None):
conf = Config()
base = ['interfaces', 'wirelessmodem']
wwan = get_interface_dict(conf, base)
+
return wwan
def verify(wwan):
@@ -56,7 +57,8 @@ 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(find_device_file(wwan['device'])):
+ dev_path = find_device_file(wwan['device'])
+ if dev_path is None or not os.path.exists(dev_path):
raise ConfigError('Device "{device}" does not exist'.format(**wwan))
verify_vrf(wwan)
@@ -89,21 +91,21 @@ def generate(wwan):
wwan['device'] = find_device_file(wwan['device'])
# Create PPP configuration files
- render(config_wwan, 'wwan/peer.tmpl', wwan)
+ render(config_wwan, 'wwan/peer.tmpl', wwan, trim_blocks=True)
# Create PPP chat script
- render(config_wwan_chat, 'wwan/chat.tmpl', wwan)
+ render(config_wwan_chat, 'wwan/chat.tmpl', wwan, trim_blocks=True)
# generated script file must be executable
# Create script for ip-pre-up.d
render(script_wwan_pre_up, 'wwan/ip-pre-up.script.tmpl',
- wwan, permission=0o755)
+ wwan, trim_blocks=True, permission=0o755)
# Create script for ip-up.d
render(script_wwan_ip_up, 'wwan/ip-up.script.tmpl',
- wwan, permission=0o755)
+ wwan, trim_blocks=True, permission=0o755)
# Create script for ip-down.d
render(script_wwan_ip_down, 'wwan/ip-down.script.tmpl',
- wwan, permission=0o755)
+ wwan, trim_blocks=True, permission=0o755)
return None