summaryrefslogtreecommitdiffstats
path: root/cobbler/item_distro.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-10-13 12:30:43 -0400
committerJim Meyering <jim@meyering.net>2006-10-13 12:30:43 -0400
commitcd9b923b946c45c5a732fa6e053a59c0f9fcb40e (patch)
tree6bc459a428a53416c4aa55a68553dd3c9c5e48aa /cobbler/item_distro.py
parent6e84895b828b4fa5e3c45464dd08949fa382dfa5 (diff)
downloadthird_party-cobbler-cd9b923b946c45c5a732fa6e053a59c0f9fcb40e.tar.gz
third_party-cobbler-cd9b923b946c45c5a732fa6e053a59c0f9fcb40e.tar.xz
third_party-cobbler-cd9b923b946c45c5a732fa6e053a59c0f9fcb40e.zip
Import feature added (usable for things like /mnt/redhat)
Diffstat (limited to 'cobbler/item_distro.py')
-rw-r--r--cobbler/item_distro.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index 0d0f26d..9af47f4 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -38,6 +38,7 @@ class Distro(item.Item):
self.initrd = None
self.kernel_options = ""
self.ks_meta = ""
+ self.arch = "x86"
def from_datastruct(self,seed_data):
"""
@@ -48,6 +49,7 @@ class Distro(item.Item):
self.initrd = self.load_item(seed_data,'initrd')
self.kernel_options = self.load_item(seed_data,'kernel_options')
self.ks_meta = self.load_item(seed_data,'ks_meta')
+ self.arch = self.load_item(seed_data,'arch',"x86")
return self
def set_kernel(self,kernel):
@@ -73,6 +75,28 @@ class Distro(item.Item):
return True
raise cexceptions.CobblerException("no_initrd")
+ def set_arch(self,arch):
+ """
+ The field is mainly relevant to PXE provisioning.
+
+ Should someone have Itanium machines on a network, having
+ syslinux (pxelinux.0) be the only option in the config file causes
+ problems.
+
+ Using an alternative distro type allows for dhcpd.conf templating
+ to "do the right thing" with those systems -- this also relates to
+ bootloader configuration files which have different syntax for different
+ distro types (because of the bootloaders).
+
+ This field is named "arch" because mainly on Linux, we only care about
+ the architecture, though if (in the future) new provisioning types
+ are added, an arch value might be something like "bsd_x86".
+ """
+ if arch in [ "standard", "ia64", "x86", "x86_64" ]:
+ self.arch = arch
+ return True
+ raise cexceptions.CobblerException("exc_pxe_arch")
+
def is_valid(self):
"""
A distro requires that the kernel and initrd be set. All
@@ -91,7 +115,8 @@ class Distro(item.Item):
'kernel': self.kernel,
'initrd' : self.initrd,
'kernel_options' : self.kernel_options,
- 'ks_meta' : self.ks_meta
+ 'ks_meta' : self.ks_meta,
+ 'arch' : self.arch
}
def printable(self, id):
@@ -112,6 +137,7 @@ 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 + "architecture : %s\n" % self.arch
buf = buf + "ks metadata : %s\n" % self.ks_meta
return buf