summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorKim <kim.sidney@gmail.com>2019-07-02 21:07:55 +0200
committerGitHub <noreply@github.com>2019-07-02 21:07:55 +0200
commit66ddc5c8117206dbd13b66661de49cf810f6c2a9 (patch)
treebc6467bc9e269caaf170bf2771c4fdf3c579d570 /src/conf_mode
parent438232f88751ac2d30b8b218c59ad5993d701a6d (diff)
parentffbe5399cfd94227b74754607a9e411b7d356eec (diff)
downloadvyos-1x-66ddc5c8117206dbd13b66661de49cf810f6c2a9.tar.gz
vyos-1x-66ddc5c8117206dbd13b66661de49cf810f6c2a9.zip
Merge pull request #84 from UnicronNL/crux
T1497: "set system name-server" generates invalid/incorrect resolv.conf
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/host_name.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py
index a0ed815ae..c5268df2a 100755
--- a/src/conf_mode/host_name.py
+++ b/src/conf_mode/host_name.py
@@ -116,7 +116,12 @@ def get_config(arguments):
for search in conf.return_values("system domain-search domain"):
hosts['domain_search'].append(search)
- hosts['nameserver'] = conf.return_values("system name-server")
+ if conf.exists("system name-server"):
+ if not isinstance(conf.return_values("system name-server"), list):
+ hosts['nameserver'] = conf.return_values("system name-server").replace("'", "").split()
+ else:
+ hosts['nameserver'] = conf.return_values("system name-server")
+
hosts['no_dhcp_ns'] = conf.exists('system disable-dhcp-nameservers')
return hosts