summaryrefslogtreecommitdiff
path: root/src/conf_mode/dns_forwarding.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-06-11 08:21:21 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-06-11 22:10:47 +0200
commit2b49fbf65aace72a9cd5629db48ae211e18a4e4a (patch)
tree370dd3704aee3bac68362fa4d0b07dc49d6ee6a0 /src/conf_mode/dns_forwarding.py
parent96595b42259e0e386e15f657857934fa20a55ca6 (diff)
downloadvyos-1x-2b49fbf65aace72a9cd5629db48ae211e18a4e4a.tar.gz
vyos-1x-2b49fbf65aace72a9cd5629db48ae211e18a4e4a.zip
dns forwarding: T2486: remove unneeded --dhclient argument
The functionality was moved to vyos-hostsd.
Diffstat (limited to 'src/conf_mode/dns_forwarding.py')
-rwxr-xr-xsrc/conf_mode/dns_forwarding.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index 26a651c3d..188a39ef0 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -15,14 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-import argparse
from sys import exit
from copy import deepcopy
from vyos.config import Config
from vyos.hostsd_client import Client as hostsd_client
-from vyos.util import wait_for_commit_lock
from vyos import ConfigError
from vyos.util import call
from vyos.template import render
@@ -30,10 +28,6 @@ from vyos.template import render
from vyos import airbag
airbag.enable()
-parser = argparse.ArgumentParser()
-parser.add_argument("--dhclient", action="store_true",
- help="Started from dhclient-script")
-
pdns_rec_run_dir = '/run/powerdns'
pdns_rec_lua_conf_file = f'{pdns_rec_run_dir}/recursor.conf.lua'
pdns_rec_hostsd_lua_conf_file = f'{pdns_rec_run_dir}/recursor.vyos-hostsd.conf.lua'
@@ -52,16 +46,11 @@ default_config_data = {
}
-def get_config(arguments):
+def get_config():
dns = deepcopy(default_config_data)
conf = Config()
base = ['service', 'dns', 'forwarding']
- if arguments.dhclient:
- conf.exists = conf.exists_effective
- conf.return_value = conf.return_effective_value
- conf.return_values = conf.return_effective_values
-
if not conf.exists(base):
return None
@@ -172,15 +161,10 @@ def apply(dns):
call("systemctl restart pdns-recursor.service")
if __name__ == '__main__':
- args = parser.parse_args()
- if args.dhclient:
- # There's a big chance it was triggered by a commit still in progress
- # so we need to wait until the new values are in the running config
- wait_for_commit_lock()
try:
- c = get_config(args)
+ c = get_config()
verify(c)
generate(c)
apply(c)