Skip to content

Commit

Permalink
Add dhcp_tag field to slave interfaces in manage_isc.py.
Browse files Browse the repository at this point in the history
This change allows for PXE booting from system records containing
a bonded interface configuration. Without this dhcp_tag the
slave interfaces would not be included in the dhcp_tags dict
used in dhcp.template.
  • Loading branch information
jmaas committed Jul 14, 2016
1 parent ae40e3b commit 84ffb0d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cobbler/modules/manage_isc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, collection_mgr, logger):
def write_dhcp_file(self):
"""
DHCP files are written when manage_dhcp is set in
/var/lib/cobbler/settings.
/etc/cobbler/settings.
"""

template_file = "/etc/cobbler/dhcp.template"
Expand Down Expand Up @@ -106,6 +106,7 @@ def write_dhcp_file(self):
# exist
continue
ip = system.interfaces[interface["interface_master"]]["ip_address"]
dtag = system.interfaces[interface["interface_master"]]["dhcp_tag"]
if ip is None or ip == "":
for (nam2, int2) in system.interfaces.iteritems():
if (nam2.startswith(interface["interface_master"] + ".") and int2["ip_address"] is not None and int2["ip_address"] != ""):
Expand All @@ -117,6 +118,7 @@ def write_dhcp_file(self):
interface["if_gateway"] = system.interfaces[interface["interface_master"]]["if_gateway"]
else:
ip = interface["ip_address"]
dtag = interface["dhcp_tag"]
host = interface["dns_name"]

if distro is not None:
Expand Down Expand Up @@ -165,7 +167,7 @@ def write_dhcp_file(self):
else:
interface["filename"] = yaboot

dhcp_tag = interface["dhcp_tag"]
dhcp_tag = dtag
if dhcp_tag == "":
dhcp_tag = "default"

Expand Down

0 comments on commit 84ffb0d

Please sign in to comment.