Skip to content

Commit

Permalink
Backport of #1912. Fix corruption of slave IP addresses.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaas committed Jul 19, 2018
1 parent b1d02c5 commit da2459a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cobbler/modules/manage_isc.py
Expand Up @@ -22,6 +22,7 @@
"""

import time
import copy

import cobbler.templar as templar
import cobbler.utils as utils
Expand Down Expand Up @@ -95,12 +96,17 @@ def write_dhcp_file(self):
distro = profile.get_conceptual_parent()

# if distro is None then the profile is really an image record
for (name, interface) in system.interfaces.iteritems():
for (name, system_interface) in system.interfaces.iteritems():

# We make a copy because we may modify it before adding it to the dhcp_tags
# and we don't want to affect the master copy.
interface = copy.deepcopy(system_interface)

if interface["if_gateway"]:
interface["gateway"] = interface["if_gateway"]
else:
interface["gateway"] = system.gateway

# this is really not a per-interface setting
# but we do this to make the templates work
# without upgrade
interface["gateway"] = system.gateway
mac = interface["mac_address"]

if interface["interface_type"] in ("bond_slave", "bridge_slave", "bonded_bridge_slave"):
Expand Down

0 comments on commit da2459a

Please sign in to comment.