summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-24 17:08:57 -0400
committerJim Meyering <jim@meyering.net>2006-10-24 17:08:57 -0400
commitc860fa03836d2d62cf32faca0b09025037bd5d93 (patch)
tree76f909b89e018af54cf5ab8ddc7533d5b72b6b1e
parent64f19e812c0328795a38a9ee10cdca3fbd3c81ac (diff)
downloadthird_party-cobbler-c860fa03836d2d62cf32faca0b09025037bd5d93.tar.gz
third_party-cobbler-c860fa03836d2d62cf32faca0b09025037bd5d93.tar.xz
third_party-cobbler-c860fa03836d2d62cf32faca0b09025037bd5d93.zip
Allow default kickstart to be modified by the user (say they wanted to use
a http url that responded to the source IP, an existing NFS file, ex)
-rw-r--r--cobbler/item_profile.py3
-rw-r--r--cobbler/settings.py44
2 files changed, 28 insertions, 19 deletions
diff --git a/cobbler/item_profile.py b/cobbler/item_profile.py
index 692e35f..b5ab7d2 100644
--- a/cobbler/item_profile.py
+++ b/cobbler/item_profile.py
@@ -23,6 +23,7 @@ class Profile(item.Item):
Constructor. Requires a backreference to Config.
"""
self.config = config
+ self.settings = self.config.settings()
self.clear()
def clear(self):
@@ -31,7 +32,7 @@ class Profile(item.Item):
"""
self.name = None
self.distro = None # a name, not a reference
- self.kickstart = "/etc/cobbler/default.ks"
+ self.kickstart = self.settings.default_kickstart
self.kernel_options = ''
self.ks_meta = ''
self.xen_name = 'xenguest'
diff --git a/cobbler/settings.py b/cobbler/settings.py
index 9e03666..276e1ed 100644
--- a/cobbler/settings.py
+++ b/cobbler/settings.py
@@ -17,6 +17,27 @@ import utils
TESTMODE = False
+DEFAULTS = {
+ "httpd_bin" : "/usr/sbin/httpd",
+ "dhcpd_conf" : "/etc/dhcpd.conf",
+ "tftpd_bin" : "/usr/sbin/in.tftpd",
+ "server" : "127.0.0.1",
+ "next_server" : "127.0.0.1",
+ "dhcpd_bin" : "/usr/sbin/dhcpd",
+ "kernel_options" : "append devfs=nomount ramdisk_size=16438 lang= vga=788 ksdevice=eth0",
+ "tftpd_conf" : "/etc/xinetd.d/tftp",
+ "tftpboot" : "/tftpboot",
+ "webdir" : "/var/www/cobbler",
+ "default_kickstart" : "/etc/cobbler/default.ks",
+ "manage_dhcp" : 0,
+ "koan_path" : "",
+ "bootloaders" : {
+ "standard" : "/usr/lib/syslinux/pxelinux.0",
+ "ia64" : "/var/lib/cobbler/elilo-3.6-ia64.efi"
+ }
+}
+
+
class Settings(serializable.Serializable):
def filename(self):
@@ -38,24 +59,7 @@ class Settings(serializable.Serializable):
"""
Reset this object to reasonable default values.
"""
- self._attributes = {
- "httpd_bin" : "/usr/sbin/httpd",
- "dhcpd_conf" : "/etc/dhcpd.conf",
- "tftpd_bin" : "/usr/sbin/in.tftpd",
- "server" : "127.0.0.1",
- "next_server" : "127.0.0.1",
- "dhcpd_bin" : "/usr/sbin/dhcpd",
- "kernel_options" : "append devfs=nomount ramdisk_size=16438 lang= vga=788 ksdevice=eth0",
- "tftpd_conf" : "/etc/xinetd.d/tftp",
- "tftpboot" : "/tftpboot",
- "webdir" : "/var/www/cobbler",
- "manage_dhcp" : 0,
- "koan_path" : "",
- "bootloaders" : {
- "standard" : "/usr/lib/syslinux/pxelinux.0",
- "ia64" : "/var/lib/cobbler/elilo-3.6-ia64.efi"
- }
- }
+ self._attributes = DEFAULTS
def printable(self):
buf = ""
@@ -82,6 +86,10 @@ class Settings(serializable.Serializable):
def __getattr__(self,name):
if self._attributes.has_key(name):
return self._attributes[name]
+ elif DEFAULTS.has_key(name):
+ lookup = DEFAULTS[name]
+ self._attributes[name] = lookup
+ return lookup
else:
raise AttributeError, name