summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2007-03-22 14:42:20 -0400
committerJim Meyering <jim@meyering.net>2007-03-22 14:42:20 -0400
commitae56edfe35b9fb058967b296dfda17f620215353 (patch)
treef69a303570ca26e93f960b41513c56f4f9a0d6f6 /cobbler
parent98b98b5dbf609e6b78da863e6361fe22b24be5b8 (diff)
downloadthird_party-cobbler-ae56edfe35b9fb058967b296dfda17f620215353.tar.gz
third_party-cobbler-ae56edfe35b9fb058967b296dfda17f620215353.tar.xz
third_party-cobbler-ae56edfe35b9fb058967b296dfda17f620215353.zip
Ongoing work for 0.4.4 -- misc tweaks/fixes, and continuation on the kernel-parameters-get-shorter effort
as well as templating and import features. Plus some random things, like case insensitive paths and some additional argument checking.
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/action_import.py1
-rw-r--r--cobbler/action_litesync.py2
-rw-r--r--cobbler/action_sync.py19
-rwxr-xr-xcobbler/cobbler.py9
-rw-r--r--cobbler/collection.py7
-rw-r--r--cobbler/settings.py2
6 files changed, 20 insertions, 20 deletions
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 770d031..8afbabd 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -274,6 +274,7 @@ class Importer:
name = name.replace("images-","")
name = name.replace("tree-","")
name = name.replace("--","-")
+ name = name.replace("-pxeboot","")
return name
def get_pxe_arch(self,dirname):
diff --git a/cobbler/action_litesync.py b/cobbler/action_litesync.py
index fddea9d..825bcbe 100644
--- a/cobbler/action_litesync.py
+++ b/cobbler/action_litesync.py
@@ -68,6 +68,8 @@ class BootLiteSync:
self.sync.rmtree(os.path.join(self.settings.webdir, "images", name))
# delete contents of images/$name in tftpboot
self.sync.rmtree(os.path.join(self.settings.tftpboot, "images", name))
+ # delete potential symlink to tree in webdir/links
+ self.sync.rmfile(os.path.join(self.settings.webdir, "links", name))
def add_single_profile(self, name):
# get the profile object:
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py
index decadd1..98f018b 100644
--- a/cobbler/action_sync.py
+++ b/cobbler/action_sync.py
@@ -453,13 +453,10 @@ class BootSync:
Cheetah and save as out_path.
"""
- print "DEBUG: AT: ... ", out_path
if type(data_input) != str:
- print "DEBUG: from file"
data = data_input.read()
else:
- print "DEBUG: from string"
data = data_input
# backward support for Cobbler's legacy (and slightly more readable)
@@ -468,18 +465,13 @@ class BootSync:
data = "#errorCatcher Echo\n" + data
- print "DEBUG: data in = %s" % data
t = Template(source=data, searchList=[metadata])
data_out = str(t)
- print "DEBUG: data out = %s" % data_out
if out_path is not None:
- print "DEBUG: making: %s" % os.path.dirname(out_path)
self.mkdir(os.path.dirname(out_path))
fd = open(out_path, "w+")
fd.write(data_out)
fd.close()
- else:
- print "DEBUG: out_path: %s" % out_path
return data_out
def build_trees(self):
@@ -590,16 +582,12 @@ class BootSync:
distro = self.distros.find(profile.distro)
contents = self.write_pxe_file(None,None,profile,distro,False,include_header=False)
if contents is not None:
- pxe_menu_items = pxe_menu_items + contents
+ pxe_menu_items = pxe_menu_items + contents + "\n"
# save the template.
- print "DEBUG: src = %s" % template_data
metadata = { "pxe_menu_items" : pxe_menu_items }
- print "DEBUG: metadata = %s" % metadata
outfile = os.path.join(self.settings.tftpboot, "pxelinux.cfg", "default")
- print "DEBUG: outfile = %s" % outfile
self.apply_template(template_data, metadata, outfile)
- print "** DEBUG: APPLIED **"
template_src.close()
@@ -654,11 +642,14 @@ class BootSync:
distro.kernel_options
))
+
# ---
# generate the append line
append_line = "append %s" % self.hash_to_string(kopts)
if not is_ia64:
append_line = "%s initrd=%s" % (append_line, initrd_path)
+ if len(append_line) >= 255 + len("append "):
+ print "warning: kernel option length exceeds 255"
# ---
# kickstart path rewriting (get URLs for local files)
@@ -679,7 +670,7 @@ class BootSync:
# store variables for templating
metadata["menu_label"] = ""
if not is_ia64 and system is None:
- metadata["menu_label"] = "MENU LABEL %s\n" % profile.name
+ metadata["menu_label"] = "MENU LABEL %s" % profile.name
metadata["profile_name"] = profile.name
metadata["kernel_path"] = kernel_path
metadata["initrd_path"] = initrd_path
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py
index bdf892f..de0ab18 100755
--- a/cobbler/cobbler.py
+++ b/cobbler/cobbler.py
@@ -151,16 +151,23 @@ class BootCLI:
def report(self,args):
args.append("") # filler
-
+ match = False
for a in args:
if a == '--distros' or len(args) == 1:
self.distro_report([])
+ match = True
if a == '--repos' or len(args) == 1:
self.repo_report([])
+ match = True
if a == '--profiles' or len(args) == 1:
self.profile_report([])
+ match = True
if a == '--systems' or len(args) == 1:
self.system_report([])
+ match = True
+ if not match and a is not None and a != "":
+ raise cexceptions.CobblerException("unknown_cmd",a)
+ match = False
def system_remove(self,args):
"""
diff --git a/cobbler/collection.py b/cobbler/collection.py
index 617ce09..c7e9f46 100644
--- a/cobbler/collection.py
+++ b/cobbler/collection.py
@@ -56,11 +56,12 @@ class Collection(serializable.Serializable):
Return anything named 'name' in the collection, else return None if
no objects can be found.
"""
- if name in self.listing.keys():
- return self.listing[name]
+ n1 = name.lower()
+ for key in self.listing.keys():
+ if key.lower() == n1:
+ return self.listing[name]
return None
-
def to_datastruct(self):
"""
Serialize the collection
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 68ea9b4..9a215c4 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -25,8 +25,6 @@ DEFAULTS = {
"next_server" : "127.0.0.1",
"dhcpd_bin" : "/usr/sbin/dhcpd",
"kernel_options" : {
- "devfs" : "nomount",
- "ramdisk_size" : 16438,
"lang" : " ",
"text" : None,
"ksdevice" : "eth0",