summaryrefslogtreecommitdiff
path: root/src/conf-mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf-mode')
-rwxr-xr-xsrc/conf-mode/vyos-config-dns-forwarding.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/conf-mode/vyos-config-dns-forwarding.py b/src/conf-mode/vyos-config-dns-forwarding.py
index 1aa42e1c1..df273b321 100755
--- a/src/conf-mode/vyos-config-dns-forwarding.py
+++ b/src/conf-mode/vyos-config-dns-forwarding.py
@@ -18,7 +18,6 @@
import sys
import os
-import time
import netifaces
import jinja2
@@ -161,6 +160,10 @@ def get_config():
return dns
def verify(dns):
+ # bail out early - looks like removal from running config
+ if dns is None:
+ return None
+
if not dns['interfaces']:
raise ConfigError('Error: DNS forwarding requires a configured listen interface!')
@@ -178,6 +181,10 @@ def verify(dns):
return None
def generate(dns):
+ # bail out early - looks like removal from running config
+ if dns is None:
+ return None
+
tmpl = jinja2.Template(config_tmpl)
config_text = tmpl.render(dns)
@@ -186,7 +193,7 @@ def generate(dns):
return None
def apply(dns):
- if dns:
+ if dns is not None:
os.system("systemctl restart pdns-recursor")
else:
# DNS forwarding is removed in the commit