summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnicronNL <kim.sidney@gmail.com>2019-07-02 20:59:59 +0200
committerUnicronNL <kim.sidney@gmail.com>2019-07-02 20:59:59 +0200
commitffbe5399cfd94227b74754607a9e411b7d356eec (patch)
treebc6467bc9e269caaf170bf2771c4fdf3c579d570
parent438232f88751ac2d30b8b218c59ad5993d701a6d (diff)
downloadvyos-1x-ffbe5399cfd94227b74754607a9e411b7d356eec.tar.gz
vyos-1x-ffbe5399cfd94227b74754607a9e411b7d356eec.zip
T1497: "set system name-server" generates invalid/incorrect resolv.conf
-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