Commit 9de3b035 by anatoly techtonik Committed by James Cammarata

setup: Fix KeyError: 'ipv4_secondaries' (issue #6274)

parent f7c4668a
......@@ -1562,13 +1562,13 @@ class LinuxNetwork(Network):
iface = words[-1]
if iface != device:
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]:
interfaces[iface]['ipv4'] = {'address': address,
'netmask': netmask,
'network': network}
else:
if "ipv4_secondaries" not in interfaces[iface]:
interfaces[iface]["ipv4_secondaries"] = []
interfaces[iface]["ipv4_secondaries"].append({
'address': address,
'netmask': netmask,
......@@ -1577,6 +1577,8 @@ class LinuxNetwork(Network):
# add this secondary IP to the main device
if secondary:
if "ipv4_secondaries" not in interfaces[device]:
interfaces[device]["ipv4_secondaries"] = []
interfaces[device]["ipv4_secondaries"].append({
'address': address,
'netmask': netmask,
......
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