Browse Source

Fix /etc/hosts contents avoiding duplicates

Change-Id: I1bffc95697a5765f47c33dbf262e4efb10472c82
pull/122/head
Olivier Bourdon 7 years ago
parent
commit
f41c3ed80b
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      linux/files/hosts

+ 5
- 0
linux/files/hosts View File

], ],
} -%} } -%}
{%- for name, host in host_dict.iteritems() -%} {%- for name, host in host_dict.iteritems() -%}
{%- for hname in host.names -%}
{%- if hname in hosts.get('127.0.1.1', []) -%}
{%- do hosts.pop('127.0.1.1') -%}
{%- endif %}
{%- endfor %}
{%- do hosts.update({host.address: host.names}) -%} {%- do hosts.update({host.address: host.names}) -%}
{%- endfor %} {%- endfor %}
{% for address, entries in hosts|dictsort %} {% for address, entries in hosts|dictsort %}

Loading…
Cancel
Save