From fc211ac1a0be80b95923a8186dfb893a1303fe9c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 18 Oct 2013 23:58:34 +0200 Subject: [PATCH] setup module, replace ':' by '_' in interface name, fix #4586 --- library/system/setup | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/system/setup b/library/system/setup index 2898ce67653..7f5ef6b3b2a 100755 --- a/library/system/setup +++ b/library/system/setup @@ -1515,7 +1515,15 @@ class LinuxNetwork(Network): stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0] parse_ip_output(primary_data) parse_ip_output(secondary_data, secondary=True) - return interfaces, ips + + # replace : by _ in interface name since they are hard to use in template + new_interfaces = {} + for i in interfaces: + if ':' in i: + new_interfaces[i.replace(':','_')] = interfaces[i] + else: + new_interfaces[i] = interfaces[i] + return new_interfaces, ips class GenericBsdIfconfigNetwork(Network): """