Commit 4c82b129 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Luis Henriques

UBUNTU: hv_set_ifconfig -- handle DHCP interfaces correctly

BugLink: http://bugs.launchpad.net/bugs/1640109Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Acked-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 61968528
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment