summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-05-29 15:29:44 -0400
committerMichael DeHaan <mdehaan@redhat.com>2008-05-29 15:29:44 -0400
commit1a1b827947e3c50e7e1e31595df6909371c8d256 (patch)
tree67a5a6f4f5bb122889208e49ccbad61090930b9d
parentc229ab1045d0d0668984d09026c6de74ec74eb33 (diff)
downloadthird_party-cobbler-1a1b827947e3c50e7e1e31595df6909371c8d256.tar.gz
third_party-cobbler-1a1b827947e3c50e7e1e31595df6909371c8d256.tar.xz
third_party-cobbler-1a1b827947e3c50e7e1e31595df6909371c8d256.zip
Default arches to 'i386' to be consistent with the trees
-rw-r--r--CHANGELOG1
-rw-r--r--cobbler/action_import.py16
-rw-r--r--cobbler/item_distro.py12
-rw-r--r--cobbler/pxegen.py4
-rw-r--r--webui_templates/distro_edit.tmpl6
5 files changed, 25 insertions, 14 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 774b02f..99e84cf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ Cobbler CHANGELOG
- Thr May 28 2008 - 1.0.1
- Fix misformatted warning in "check"
- Do not own tftpboot
+- Default arches to 'i386' not 'x86' for consistency, esp. in import
- Wed May 27 2008 - 1.0.0
- Merge devel branch onto master, this is 1.0
diff --git a/cobbler/action_import.py b/cobbler/action_import.py
index 3e726a6..9ebd9e8 100644
--- a/cobbler/action_import.py
+++ b/cobbler/action_import.py
@@ -70,8 +70,11 @@ class Importer:
raise CX(_("import failed. no --name specified"))
if self.arch is not None:
self.arch = self.arch.lower()
- if self.arch not in [ "x86", "ia64", "x86_64" ]:
+ if self.arch not in [ "i386", "x86", "ia64", "x86_64" ]:
raise CX(_("arch must be x86, x86_64, or ia64"))
+ if self.arch == "x86":
+ # be consistent
+ self.arch = "i386"
mpath = os.path.join(self.settings.webdir, "ks_mirror", self.mirror_name)
@@ -523,6 +526,7 @@ class Importer:
def get_proposed_name(self,dirname,pxe_arch):
archname = pxe_arch
if archname == "x86":
+ # be consistent
archname = "i386"
# FIXME: this is new, needs testing ...
if self.network_root is not None:
@@ -546,6 +550,8 @@ class Importer:
name = name.replace("_x86_64","")
name = name.replace("-ia64","")
name = name.replace("_ia64","")
+ name = name.replace("-x86","")
+ name = name.replace("_x86","")
# ensure arch is on the end, regardless of path used.
name = name + "-" + archname
@@ -572,7 +578,7 @@ class Importer:
if x.find("kernel-header") != -1:
print _("- kernel header found: %s") % x
if x.find("i386") != -1:
- foo["result"] = "x86"
+ foo["result"] = "i386"
return
elif x.find("x86_64") != -1:
foo["result"] = "x86_64"
@@ -590,7 +596,7 @@ class Importer:
if x.find("kernel-largesmp") != -1:
print _("- kernel header found: %s") % x
if x.find("i386") != -1:
- foo["result"] = "x86"
+ foo["result"] = "i386"
return
elif x.find("x86_64") != -1:
foo["result"] = "x86_64"
@@ -609,7 +615,7 @@ class Importer:
"""
dirname2 = "/".join(dirname.split("/")[:-2]) # up two from images, then down as many as needed
print _("- scanning %s for architecture info") % dirname2
- result = { "result" : "x86" } # default, but possibly not correct ...
+ result = { "result" : "i386" } # default, but possibly not correct ...
os.path.walk(dirname2, self.arch_walker, result)
return result["result"]
@@ -620,7 +626,7 @@ class Importer:
if t.find("ia64") != -1:
return "ia64"
if t.find("i386") != -1 or t.find("386") != -1 or t.find("x86") != -1:
- return "x86"
+ return "i386"
return self.learn_arch_from_tree(dirname)
def is_relevant_dir(self,dirname):
diff --git a/cobbler/item_distro.py b/cobbler/item_distro.py
index 1a4c296..3a94604 100644
--- a/cobbler/item_distro.py
+++ b/cobbler/item_distro.py
@@ -37,7 +37,7 @@ class Distro(item.Item):
self.initrd = (None, '<<inherit>>')[is_subobject]
self.kernel_options = ({}, '<<inherit>>')[is_subobject]
self.ks_meta = ({}, '<<inherit>>')[is_subobject]
- self.arch = ('x86', '<<inherit>>')[is_subobject]
+ self.arch = ('i386', '<<inherit>>')[is_subobject]
self.breed = ('redhat', '<<inherit>>')[is_subobject]
self.source_repos = ([], '<<inherit>>')[is_subobject]
self.depth = 0
@@ -66,12 +66,13 @@ 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')
+ self.arch = self.load_item(seed_data,'arch','i386')
self.breed = self.load_item(seed_data,'breed','redhat')
self.source_repos = self.load_item(seed_data,'source_repos',[])
self.depth = self.load_item(seed_data,'depth',0)
- # backwards compatibility -- convert string entries to dicts for storage
+ # backwards compatibility enforcement
+ self.set_arch(self.arch)
if self.kernel_options != "<<inherit>>" and type(self.kernel_options) != dict:
self.set_kernel_options(self.kernel_options)
if self.ks_meta != "<<inherit>>" and type(self.ks_meta) != dict:
@@ -135,7 +136,10 @@ class Distro(item.Item):
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" ]:
+ if arch in [ "standard", "ia64", "x86", "i386", "x86_64" ]:
+ if arch == "x86":
+ # be consistent
+ arch = "i386"
self.arch = arch
return True
raise CX(_("PXE arch choices include: x86, x86_64, and ia64"))
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index a438583..94bdb2a 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -128,7 +128,7 @@ class PXEGen:
f1 = utils.get_config_filename(system,interface=name)
# for tftp only ...
- if distro.arch in [ "x86", "x86_64", "standard"]:
+ if distro.arch in [ "i386", "x86", "x86_64", "standard"]:
# pxelinux wants a file named $name under pxelinux.cfg
f2 = os.path.join(self.bootloc, "pxelinux.cfg", f1)
if distro.arch == "ia64":
@@ -143,7 +143,7 @@ class PXEGen:
f3 = os.path.join(self.settings.webdir, "systems", f1)
if system.netboot_enabled and system.is_pxe_supported():
- if distro.arch in [ "x86", "x86_64", "standard"]:
+ if distro.arch in [ "i386", "x86", "x86_64", "standard"]:
self.write_pxe_file(f2,system,profile,distro,False)
if distro.arch == "ia64":
self.write_pxe_file(f2,system,profile,distro,True)
diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl
index f72ab11..66e982d 100644
--- a/webui_templates/distro_edit.tmpl
+++ b/webui_templates/distro_edit.tmpl
@@ -104,10 +104,10 @@ function disablename(value)
<label for="arch">Architecture</label>
</td>
<td>
- #if $distro and $distro.arch == "x86"
- <input type="radio" name="arch" id="arch" value="x86" checked>x86
+ #if $distro and $distro.arch == "i386"
+ <input type="radio" name="arch" id="arch" value="i386" checked>i386
#else
- <input type="radio" name="arch" id="arch" value="x86">x86
+ <input type="radio" name="arch" id="arch" value="i386">i386
#end if
#if $distro and $distro.arch == "x86_64"
<input type="radio" name="arch" id="arch" value="x86_64" checked>x86_64