diff options
author | UnicronNL <kim.sidney@gmail.com> | 2019-07-02 20:59:59 +0200 |
---|---|---|
committer | UnicronNL <kim.sidney@gmail.com> | 2019-07-02 20:59:59 +0200 |
commit | ffbe5399cfd94227b74754607a9e411b7d356eec (patch) | |
tree | bc6467bc9e269caaf170bf2771c4fdf3c579d570 /src | |
parent | 438232f88751ac2d30b8b218c59ad5993d701a6d (diff) | |
download | vyos-1x-ffbe5399cfd94227b74754607a9e411b7d356eec.tar.gz vyos-1x-ffbe5399cfd94227b74754607a9e411b7d356eec.zip |
T1497: "set system name-server" generates invalid/incorrect resolv.conf
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/host_name.py | 7 |
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 |