summaryrefslogtreecommitdiff
path: root/src/services/vyos-hostsd
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-05-03 16:16:07 +0700
committerGitHub <noreply@github.com>2020-05-03 16:16:07 +0700
commit790c591dabab083c28120312395974a16acbdbd5 (patch)
treeca1a8c0a8174c63d792e29357bcb5873a3f4d78f /src/services/vyos-hostsd
parentf03dd18529b8c20c2183ab27e81a8d38699cf3f1 (diff)
parent4b2d2839e93f7df8e61e5f8f8a4ad94bcdb308d5 (diff)
downloadvyos-1x-790c591dabab083c28120312395974a16acbdbd5.tar.gz
vyos-1x-790c591dabab083c28120312395974a16acbdbd5.zip
Merge pull request #352 from maplewf/current
[T2311] name servers via cmdline can't take effect
Diffstat (limited to 'src/services/vyos-hostsd')
-rwxr-xr-xsrc/services/vyos-hostsd13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/services/vyos-hostsd b/src/services/vyos-hostsd
index a655762e9..647cbc8c1 100755
--- a/src/services/vyos-hostsd
+++ b/src/services/vyos-hostsd
@@ -25,6 +25,7 @@ import traceback
import re
import logging
import zmq
+import collections
import jinja2
@@ -79,8 +80,18 @@ resolv_tmpl_source = """
### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###
+# name server from static configuration
{% for ns in name_servers -%}
+{%- if name_servers[ns]['tag'] == "static" %}
nameserver {{ns}}
+{%- endif %}
+{% endfor -%}
+
+{% for ns in name_servers -%}
+{%- if name_servers[ns]['tag'] != "static" %}
+# name server from {{name_servers[ns]['tag']}}
+nameserver {{ns}}
+{%- endif %}
{% endfor -%}
{%- if domain_name %}
@@ -110,7 +121,7 @@ resolv_tmpl = jinja2.Template(resolv_tmpl_source)
# and re-created without having to track what needs
# to be changed
STATE = {
- "name_servers": {},
+ "name_servers": collections.OrderedDict({}),
"hosts": {},
"host_name": "vyos",
"domain_name": "",