From patchwork Wed Nov 9 10:23:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 692681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3tDMj33f0jz9t15; Wed, 9 Nov 2016 21:23:51 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1c4Q2m-0001p3-Fn; Wed, 09 Nov 2016 10:23:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1c4Q2d-0001nz-1v for kernel-team@lists.ubuntu.com; Wed, 09 Nov 2016 10:23:39 +0000 Received: from 1.general.apw.uk.vpn ([10.172.192.78] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1c4Q2c-0008LS-Nf; Wed, 09 Nov 2016 10:23:38 +0000 From: Andy Whitcroft To: kernel-team@lists.ubuntu.com Subject: [yakkety/master-next 1/2] UBUNTU: hv_set_ifconfig -- handle DHCP interfaces correctly Date: Wed, 9 Nov 2016 10:23:36 +0000 Message-Id: <20161109102337.6005-2-apw@canonical.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161109102337.6005-1-apw@canonical.com> References: <20161109102337.6005-1-apw@canonical.com> Cc: Andy Whitcroft X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/1640109 Signed-off-by: Andy Whitcroft Acked-by: Colin Ian King --- debian/cloud-tools/hv_set_ifconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/cloud-tools/hv_set_ifconfig b/debian/cloud-tools/hv_set_ifconfig index 4b4f49f..1ed7158 100755 --- a/debian/cloud-tools/hv_set_ifconfig +++ b/debian/cloud-tools/hv_set_ifconfig @@ -83,6 +83,7 @@ if not "HWADDR" in kvp : if not "DEVICE" in kvp : exit(1) +autolist = [] output=[] basename=kvp["DEVICE"] @@ -98,11 +99,10 @@ dns_emitted = False # IPV4 may either be dhcp or static. if ("DHCP" in kvp and kvp["DHCP"] == "yes") or \ ("BOOTPROTO" in kvp and kvp["BOOTPROTO"] == "dhcp"): - output += ["auto " + basename] + autolist.append(basename) output += ["iface " + basename + " inet dhcp"] output += [""] else: - autolist = [] # Matchup the interface specific lines # No real max for the number of interface + aliases ... @@ -168,7 +168,8 @@ for if6_count in v6names: output += [""] # Mark this new interface for automatic up. -output = ["auto "+" ".join(autolist)] + output +if len(autolist): + output = ["auto "+" ".join(autolist)] + output print("===================================") print(output)