Hi Michael
I've attached two small patches.
1. This sorts to order of systems and profiles on a buildiso .iso.
2. Ensure that directories exist when installing a template-file. The
might be a better way of doing this, but it works for me.
Dave
From 9c9501c50b49cafacdd60ddfb1a0eb9a811395fd Mon Sep 17 00:00:00 2001
From: Dave Hatton <dave(a)starground.it>
Date: Thu, 29 Jan 2009 20:05:54 +0000
Subject: [PATCH] Sort profiles and systems into order on buildsion menu
---
cobbler/action_buildiso.py | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/cobbler/action_buildiso.py b/cobbler/action_buildiso.py
index 7fa2c5a..eec6054 100644
--- a/cobbler/action_buildiso.py
+++ b/cobbler/action_buildiso.py
@@ -164,7 +164,13 @@ class BuildIso:
cfg.write(HEADER) # fixme, use template
print _("- generating profile list...")
- for profile in self.api.profiles():
+ #sort the profiles
+ profile_list = [profile for profile in self.profiles]
+ def sort_name(a,b):
+ return cmp(a.name,b.name)
+ profile_list.sort(sort_name)
+
+ for profile in profile_list:
use_this = True
if profiles is not None:
which_profiles = profiles.split(",")
@@ -204,7 +210,13 @@ class BuildIso:
cfg.write("\nMENU SEPARATOR\n")
- for system in self.api.systems():
+ #sort the systems
+ system_list = [system for system in self.systems]
+ def sort_name(a,b):
+ return cmp(a.name,b.name)
+ system_list.sort(sort_name)
+
+ for system in system_list:
use_this = False
if systems is not None:
which_systems = systems.split(",")
--
1.5.5.6
From b0ad11326d627971db7fe4cbeadfcae21de22c44 Mon Sep 17 00:00:00 2001
From: Dave Hatton <dave(a)starground.it>
Date: Fri, 30 Jan 2009 14:38:19 +0000
Subject: [PATCH] make sure the directory exists for a downloaded file
---
snippets/download_config_files | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/snippets/download_config_files b/snippets/download_config_files
index 865c43a..0444311 100644
--- a/snippets/download_config_files
+++ b/snippets/download_config_files
@@ -11,6 +11,7 @@
#end if
#set $turl =
"http://"+$http_server+"/cblr/svc/op/template/"+$ttype+"/"+$tname+"/path/"+$tpath
#if $orig.startswith("/")
+mkdir -p `dirname $orig`
wget "$turl" --output-document="$orig"
#end if
#end for
--
1.5.5.6