diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-07-12 17:00:49 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-07-12 17:00:49 -0400 |
commit | bea30de4beb585b5c79d10c6164e65713f1611bc (patch) | |
tree | 435799b37baa464c21e42e622914cbdd8b33276f /cobbler/item_distro.py | |
parent | f061199e4f8a3ea0e769325e72029ca7d791b206 (diff) | |
download | third_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.tar.gz third_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.tar.xz third_party-cobbler-bea30de4beb585b5c79d10c6164e65713f1611bc.zip |
Added templating support through new --ks_meta option which works like --kopts. The parameter is a space delimited list of key=value pairs, which allows the variables entered to be evaluated through Cheetah. Thus kickstarts are now Cheetah templates. All templating errors are ignored so usage of a $ in a template is still legal where it doesn't reference a variable. Error ignoring should be finer grained and this does need some tests. Currently this only works for kickstarts on filesystems, and I'm not sure what the behavior for http and nfs should be. Anyhow, fairly useful stuff.
Diffstat (limited to 'cobbler/item_distro.py')
-rw-r--r-- | cobbler/item_distro.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py index 7491a98..e15c2b1 100644 --- a/cobbler/item_distro.py +++ b/cobbler/item_distro.py @@ -37,6 +37,7 @@ class Distro(item.Item): self.kernel = None self.initrd = None self.kernel_options = "" + self.ks_meta = "" def from_datastruct(self,seed_data): """ @@ -46,6 +47,7 @@ class Distro(item.Item): self.kernel = seed_data['kernel'] self.initrd = seed_data['initrd'] self.kernel_options = seed_data['kernel_options'] + self.ks_meta = seed_data['ks_meta'] return self def set_kernel(self,kernel): @@ -88,7 +90,8 @@ class Distro(item.Item): 'name': self.name, 'kernel': self.kernel, 'initrd' : self.initrd, - 'kernel_options' : self.kernel_options + 'kernel_options' : self.kernel_options, + 'ks_meta' : self.ks_meta } def printable(self, id): @@ -109,5 +112,6 @@ class Distro(item.Item): buf = buf + "kernel : %s\n" % kstr buf = buf + "initrd : %s\n" % istr buf = buf + "kernel options : %s\n" % self.kernel_options + buf = buf + "ks metadata : %s\n" % self.ks_meta return buf |