From ffbe5399cfd94227b74754607a9e411b7d356eec Mon Sep 17 00:00:00 2001 From: UnicronNL Date: Tue, 2 Jul 2019 20:59:59 +0200 Subject: T1497: "set system name-server" generates invalid/incorrect resolv.conf --- src/conf_mode/host_name.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/conf_mode') 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 -- cgit v1.2.3