diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | cobbler/action_sync.py | 30 | ||||
-rw-r--r-- | cobbler/item_profile.py | 11 | ||||
-rw-r--r-- | docs/cobbler.pod | 4 |
4 files changed, 45 insertions, 2 deletions
@@ -4,6 +4,8 @@ Cobbler CHANGELOG * Fri Aug 31 2007 - 0.6.2 - cobbler repo auto-add to discover yum repos automatically - fix bug that allows empty mac addresses (None) in dhcpd.conf +- kickstarts automatically save kickstart file used to /root/cobbler.ks +- allow multiple (comma-seperated) values for --virt-size * Thu Aug 30 2007 - 0.6.1 - re enable --resolve in yumdownloader (cobbler repo mgmt feature) diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 03eeb02..c5621c6 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -353,18 +353,39 @@ class BootSync: except: traceback.print_exc() # leave this in, for now... msg = "err_kickstart2" - raise CX(_("Error copying kickstart file %(src)s to %(dest)s") % { "src" : kickstart_path, "dest" : dest }) + raise CX(_("Error while rendering kickstart file %(src)s to %(dest)s") % { "src" : kickstart_path, "dest" : dest }) def generate_kickstart_signal(self, profile, system=None): + """ + Do things that we do at the end of kickstarts... + * signal the status watcher we're done + * disable PXE if needed + * save the original kickstart file for debug + """ pattern1 = "wget http://%s/cblr/watcher.py?%s_%s=%s -b" pattern2 = "wget http://%s/cgi-bin/nopxe.cgi?system=%s -b" + pattern3 = "wget http://%s/cobbler/%s/%s/ks.cfg -O /root/cobbler.ks" + + blend_this = profile + if system: + blend_this = system + + blended = utils.blender(False, blend_this) + kickstart = blended.get("kickstart",None) + buf = "" if system is not None: buf = buf + pattern1 % (self.settings.server, "system", "done", system.name) if str(self.settings.pxe_just_once).upper() in [ "1", "Y", "YES", "TRUE" ]: buf = buf + "\n" + pattern2 % (self.settings.server, system.name) + if kickstart and os.path.exists(kickstart): + buf = buf + "\n" + pattern3 % (self.settings.server, "kickstarts_sys", system.name) + else: buf = buf + pattern1 % (self.settings.server, "profile", "done", profile.name) + if kickstart and os.path.exists(kickstart): + buf = buf + "\n" + pattern3 % (self.settings.server, "kickstarts", profile.name) + return buf def generate_repo_stanza(self, profile): @@ -526,7 +547,12 @@ class BootSync: # now do full templating scan, where we will also templatify the snippet insertions t = Template(source=data, searchList=[metadata]) - data_out = str(t) + try: + data_out = str(t) + except: + print _("There appears to be an formatting error in the template file.") + print _("For completeness, the traceback from Cheetah has been included below.") + raise # now apply some magic post-filtering that is used by cobbler import and some # other places, but doesn't use Cheetah. Forcing folks to double escape diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py index d8a7152..e66b1d9 100644 --- a/cobbler/item_profile.py +++ b/cobbler/item_profile.py @@ -167,6 +167,17 @@ class Profile(item.Item): size you want. """ # num is a non-negative integer (0 means default) + # can also be a comma seperated list -- for usage with multiple disks + + if num.find(",") != -1: + tokens = num.split(",") + for t in tokens: + # hack to run validation on each + self.set_virt_file_size(t) + # if no exceptions raised, good enough + self.virt_file_size = num + return True + try: inum = int(num) if inum != float(num): diff --git a/docs/cobbler.pod b/docs/cobbler.pod index f786b4c..62a99c8 100644 --- a/docs/cobbler.pod +++ b/docs/cobbler.pod @@ -123,6 +123,8 @@ If this parameter is not provided, the kickstart file will default to /etc/cobbl =item virt-file-size (optional) (Virt-only) how large the disk image should be in gigabytes. The default is "5". +This can be a comma seperated list (ex: "5,6,7") to allow for multiple disks of different sizes +depending on what is given to --virt-path. =item virt-ram @@ -139,6 +141,8 @@ absolute path to an existing directory with an optional file name component. There is also some experimental support for specifying partitions "/dev/sda4" or volume groups "VolGroup00", etc. +For multiple disks, seperate the values with commas such as "VolGroup00,VolGroup00" or "/dev/sda4,/dev/sda5". Both those examples would create two disks for the VM. + =item repos (optional) a space delimited list of all the repos (created with "cobbler repo add" and "cobbler reposync") that this profile |