]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
UBUNTU: [Debian] hyper-v -- fix comment handing in /etc/network/interfaces
authorAndy Whitcroft <apw@canonical.com>
Wed, 21 Jan 2015 12:52:13 +0000 (12:52 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
commite2c5209a7d7354903e2e66afd8f71e168878e380
treecad9e09de06ab83b60f6a9c8be868c04fa63a9b8
parentb795bf2aa6e053cb1dd7b20cde51efc2a2ed34d3
UBUNTU: [Debian] hyper-v -- fix comment handing in /etc/network/interfaces

We are duplicating the opening comment marker every time we rebuild the
file, such that we end up with multiple of those comments:

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    # The following stanza(s) added by hv_set_ifconfig
    # The following stanza(s) added by hv_set_ifconfig
    # The following stanza(s) added by hv_set_ifconfig
    auto eth0
    iface eth0 inet static
    address 10.100.20.108
    gateway 10.100.20.1
    dns-nameservers 8.8.4.4

    #End of hv_set_ifconfig stanzas

Fix handling of these such that we only insert new markers if they do
not already exist.  Where they do, simply inject the new stanzas at the
end of the block before the end marker.  At the same time deduplicate
sequential begin and end markers to clean up previously dammaged files.

BugLink: http://bugs.launchpad.net/bugs/1413020
Signed-off-by: Andy Whitcroft <apw@canonical.com>
debian/cloud-tools/hv_set_ifconfig