summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cobbler/action_check.py14
-rw-r--r--cobbler/action_sync.py33
-rw-r--r--cobbler/cobbler_msg.py3
-rw-r--r--cobbler/item_system.py2
-rw-r--r--cobbler/settings.py3
-rw-r--r--cobbler/utils.py2
6 files changed, 27 insertions, 30 deletions
diff --git a/cobbler/action_check.py b/cobbler/action_check.py
index e0cfc125..235685cf 100644
--- a/cobbler/action_check.py
+++ b/cobbler/action_check.py
@@ -35,7 +35,7 @@ class BootCheck:
status = []
self.check_name(status)
self.check_dhcpd_bin(status)
- self.check_pxelinux_bin(status)
+ self.check_bootloaders(status)
self.check_tftpd_bin(status)
self.check_tftpd_dir(status)
self.check_tftpd_conf(status)
@@ -67,14 +67,14 @@ class BootCheck:
if not os.path.exists(self.settings.dhcpd_bin):
status.append(cobbler_msg.lookup("no_dhcpd"))
- def check_pxelinux_bin(self,status):
+ def check_bootloaders(self,status):
"""
- Check if pxelinux (part of syslinux) is installed
+ Check if network bootloaders are installed
"""
- for pxelinux in keys(self.settings.pxelinuxes):
- filename = self.settings.pxelinuxes[pxelinux]
+ for loader in keys(self.settings.bootloaders):
+ filename = self.settings.bootloaders[loader]
if not os.path.exists(filename):
- status.append(cobbler_msg.lookup("no_pxelinux"))
+ status.append(cobbler_msg.lookup("no_bootloader"))
return
def check_tftpd_bin(self,status):
@@ -137,7 +137,7 @@ class BootCheck:
if not match_next:
status.append(cobbler_msg.lookup("no_line") % (self.settings.dhcpd_conf, 'next-server ip-address'))
if not match_file:
- status.append(cobbler_msg.lookup("no_line") % (self.settings.dhcpd_conf, 'filename "%s/pxelinux.0";' % self.settings.tftpboot))
+ status.append(cobbler_msg.lookup("no_next_server") % (self.settings.dhcpd_conf))
else:
status.append(cobbler_msg.lookup("no_exist") % self.settings.dhcpd_conf)
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index e7eb0044..af27b03e 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -53,7 +53,7 @@ class BootSync:
self.verbose = verbose
self.dryrun = dryrun
self.clean_trees()
- self.copy_pxelinux()
+ self.copy_bootloaders()
self.copy_distros()
self.validate_kickstarts()
self.configure_httpd()
@@ -61,18 +61,15 @@ class BootSync:
return True
- def copy_pxelinux(self):
+ def copy_bootloaders(self):
"""
- Copy syslinux to the configured tftpboot directory
+ Copy bootloaders to the configured tftpboot directory
NOTE: we support different arch's if defined in
/var/lib/cobbler/settings.
"""
- for pxelinux in keys(self.settings.pxelinuxes):
- path = self.settings.pxelinuxes[path]
- self.copy(path, os.path.join(self.settings.tftpboot, pxelinux))
- # for i386, save it as the canonical name also
- if pxelinux == "pxelinux.i386":
- self.copy(path, os.path.join(self.settings.tftpboot, "pxelinux.0");
+ for loader in keys(self.settings.bootloaders):
+ path = self.settings.bootloaders[path]
+ self.copy(path, os.path.join(self.settings.tftpboot, loader))
def configure_httpd(self):
"""
@@ -211,7 +208,7 @@ class BootSync:
distro = self.distros.find(profile.distro)
kickstart_path = utils.find_kickstart(profile.kickstart)
if kickstart_path and os.path.exists(kickstart_path):
- pxe_fn = self.get_pxelinux_filename(s.name)
+ pxe_fn = self.get_pxe_filename(s.name)
copy_path = os.path.join(self.settings.webdir,
"kickstarts_sys", # system kickstarts go here
pxe_fn
@@ -297,22 +294,22 @@ class BootSync:
distro = self.distros.find(profile.distro)
if distro is None:
raise cexceptions.CobblerException("orphan_distro2",system.profile,profile.distro)
- f1 = self.get_pxelinux_filename(system.name)
+ f1 = self.get_pxe_filename(system.name)
# tftp only
f2 = os.path.join(self.settings.tftpboot, "pxelinux.cfg", f1)
# http only
f3 = os.path.join(self.settings.webdir, "systems", f1)
- self.write_pxelinux_file(f2,system,profile,distro)
+ self.write_pxe_file(f2,system,profile,distro)
self.write_system_file(f3,system)
- def get_pxelinux_filename(self,name_input):
+ def get_pxe_filename(self,name_input):
"""
- The configuration file for each system pxelinux uses is either
+ The configuration file for each system pxe uses is either
a form of the MAC address of the hex version of the IP. Not sure
about ipv6 (or if that works). The system name in the config file
is either a system name, an IP, or the MAC, so figure it out, resolve
- the host if needed, and return the pxelinux directory name.
+ the host if needed, and return the pxe directory name.
"""
if name_input == "default":
return "default"
@@ -325,9 +322,9 @@ class BootSync:
raise cexceptions.CobblerException("err_resolv", name)
- def write_pxelinux_file(self,filename,system,profile,distro):
+ def write_pxe_file(self,filename,system,profile,distro):
"""
- Write a configuration file for the pxelinux boot loader.
+ Write a configuration file for the boot loader(s).
More system-specific configuration may come in later, if so
that would appear inside the system object in api.py
@@ -355,7 +352,7 @@ class BootSync:
# if kickstart path is on disk, we've already copied it into
# the HTTP mirror, so make it something anaconda can get at
if kickstart_path.startswith("/"):
- pxe_fn = self.get_pxelinux_filename(system.name)
+ pxe_fn = self.get_pxe_filename(system.name)
kickstart_path = "http://%s/cobbler/kickstarts_sys/%s/ks.cfg" % (self.settings.server, pxe_fn)
nextline = nextline + " ks=%s" % kickstart_path
self.tee(fd, nextline)
diff --git a/cobbler/cobbler_msg.py b/cobbler/cobbler_msg.py
index aff5ba80..5bda560d 100644
--- a/cobbler/cobbler_msg.py
+++ b/cobbler/cobbler_msg.py
@@ -34,12 +34,13 @@ _msg_table = {
"need_perms" : "cobbler could not access %s",
"need_perms2" : "cobbler could not copy %s to %s",
"no_dhcpd" : "cobbler couldn't find dhcpd, try 'yum install dhcpd'",
- "no_pxelinux" : "missing 1 or more pxelinux files listed in /var/lib/cobbler/settings"
+ "no_bootloader" : "missing 1 or more bootloader files listed in /var/lib/cobbler/settings"
"no_tftpd" : "cobbler couldn't find tftpd, try 'yum install tftpd'",
"no_dir" : "cobbler couldn't find %s, please create it",
"chg_attrib" : "need to change field '%s' value to '%s' in file '%s'",
"no_exist" : "file %s does not exist",
"no_line" : "file '%s' should have a line '%s' somewhere",
+ "no_next_server" : "file '%s' should have a next-server line",
"no_dir2" : "can't find %s for %s as referenced in /var/lib/cobbler/settings",
"bad_param" : "at least one parameter is missing for this function",
"empty_list" : "There are no configured %s records.",
diff --git a/cobbler/item_system.py b/cobbler/item_system.py
index ff6d447c..bde3c28e 100644
--- a/cobbler/item_system.py
+++ b/cobbler/item_system.py
@@ -73,7 +73,7 @@ class System(item.Item):
this parameter is meaningless. It only has value when
generating a dhcp file.
"""
- for arch in keys(self.config.pxelinuxes):
+ for arch in keys(self.config.bootloaders):
if arch == new_arch:
return True
raise cexceptions.CobblerException("exc_pxe_arch")
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 304f7485..547865ec 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -44,9 +44,8 @@ class Settings(serializable.Serializable):
"tftpboot" : "/tftpboot",
"webdir" : "/var/www/cobbler",
"manage_dhcp" : 0,
- "pxelinuxes" : {
+ "bootloaders" : {
"i386" : "/usr/lib/syslinux/pxelinux.0"
- "ia64" : "/no/path/to/this/file/pxelinux.0"
}
}
diff --git a/cobbler/utils.py b/cobbler/utils.py
index d59e37b8..96cfa708 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -34,7 +34,7 @@ def find_system_identifier(strdata):
"""
If the input is a MAC or an IP, return that.
If it's not, resolve the hostname and return the IP.
- pxelinux doesn't work in hostnames
+ pxe bootloaders don't work in hostnames
"""
if is_mac(strdata):
return strdata.upper()