setup: Fix KeyError: 'ipv4_secondaries' (issue #6274)
This commit is contained in:
parent
646be91bb2
commit
50512db710
1 changed files with 4 additions and 2 deletions
|
@ -1562,13 +1562,13 @@ class LinuxNetwork(Network):
|
||||||
iface = words[-1]
|
iface = words[-1]
|
||||||
if iface != device:
|
if iface != device:
|
||||||
interfaces[iface] = {}
|
interfaces[iface] = {}
|
||||||
if not secondary and "ipv4_secondaries" not in interfaces[iface]:
|
|
||||||
interfaces[iface]["ipv4_secondaries"] = []
|
|
||||||
if not secondary or "ipv4" not in interfaces[iface]:
|
if not secondary or "ipv4" not in interfaces[iface]:
|
||||||
interfaces[iface]['ipv4'] = {'address': address,
|
interfaces[iface]['ipv4'] = {'address': address,
|
||||||
'netmask': netmask,
|
'netmask': netmask,
|
||||||
'network': network}
|
'network': network}
|
||||||
else:
|
else:
|
||||||
|
if "ipv4_secondaries" not in interfaces[iface]:
|
||||||
|
interfaces[iface]["ipv4_secondaries"] = []
|
||||||
interfaces[iface]["ipv4_secondaries"].append({
|
interfaces[iface]["ipv4_secondaries"].append({
|
||||||
'address': address,
|
'address': address,
|
||||||
'netmask': netmask,
|
'netmask': netmask,
|
||||||
|
@ -1577,6 +1577,8 @@ class LinuxNetwork(Network):
|
||||||
|
|
||||||
# add this secondary IP to the main device
|
# add this secondary IP to the main device
|
||||||
if secondary:
|
if secondary:
|
||||||
|
if "ipv4_secondaries" not in interfaces[device]:
|
||||||
|
interfaces[device]["ipv4_secondaries"] = []
|
||||||
interfaces[device]["ipv4_secondaries"].append({
|
interfaces[device]["ipv4_secondaries"].append({
|
||||||
'address': address,
|
'address': address,
|
||||||
'netmask': netmask,
|
'netmask': netmask,
|
||||||
|
|
Loading…
Reference in a new issue