diff options
-rw-r--r-- | cobbler/item_repo.py | 3 | ||||
-rw-r--r-- | cobbler/utils.py | 20 | ||||
-rw-r--r-- | webui_templates/distro_edit.tmpl | 6 | ||||
-rw-r--r-- | webui_templates/repo_edit.tmpl | 18 |
4 files changed, 38 insertions, 9 deletions
diff --git a/cobbler/item_repo.py b/cobbler/item_repo.py index c68c7787..02622004 100644 --- a/cobbler/item_repo.py +++ b/cobbler/item_repo.py @@ -83,6 +83,7 @@ class Repo(item.Item): self.set_mirror_locally(self.mirror_locally) self.set_owners(self.owners) self.set_environment(self.environment) + self.set_arch(self.arch) self._guess_breed() self.uid = self.load_item(seed_data,'uid','') @@ -198,7 +199,7 @@ class Repo(item.Item): """ Override the arch used for reposync """ - return utils.set_arch(self,arch) + return utils.set_arch(self,arch,repo=True) def is_valid(self): """ diff --git a/cobbler/utils.py b/cobbler/utils.py index dc9e043d..8f4cebaa 100644 --- a/cobbler/utils.py +++ b/cobbler/utils.py @@ -1045,16 +1045,20 @@ def set_redhat_management_key(self,key): self.redhat_management_key = key return True -def set_arch(self,arch): - if arch is None or arch == "": - arch = "x86" - if arch in [ "standard", "ia64", "x86", "i386", "ppc", "ppc64", "x86_64", "s390", "s390x" ]: - if arch == "x86" or arch == "standard": - # be consistent - arch = "i386" +def set_arch(self,arch,repo=False): + if arch is None or arch == "" or arch == "standard" or arch == "x86": + arch = "i386" + + if repo: + valids = [ "i386", "x86_64", "ia64", "ppc", "ppc64", "s390", "s390x", "noarch", "src" ] + else: + valids = [ "i386", "x86_64", "ia64", "ppc", "ppc64", "s390", "s390x" ] + + if arch in valids: self.arch = arch return True - raise CX(_("arch choices include: x86, x86_64, ppc, ppc64, s390, s390x and ia64")) + + raise CX("arch choices include: %s" % ", ".join(valids)) def set_os_version(self,os_version): if os_version == "" or os_version is None: diff --git a/webui_templates/distro_edit.tmpl b/webui_templates/distro_edit.tmpl index bf52f407..adf2731b 100644 --- a/webui_templates/distro_edit.tmpl +++ b/webui_templates/distro_edit.tmpl @@ -162,6 +162,12 @@ function disablename(value) #else <input type="radio" name="arch" id="arch" value="ppc64">ppc64 #end if + + #if $distro and $distro.arch == "s390" + <input type="radio" name="arch" id="arch" value="s390" checked>s390 + #else + <input type="radio" name="arch" id="arch" value="s390">s390 + #end if #if $distro and $distro.arch == "s390x" <input type="radio" name="arch" id="arch" value="s390x" checked>s390x diff --git a/webui_templates/repo_edit.tmpl b/webui_templates/repo_edit.tmpl index 78544759..62f0e9ed 100644 --- a/webui_templates/repo_edit.tmpl +++ b/webui_templates/repo_edit.tmpl @@ -228,6 +228,11 @@ function disablename(value) #else <input type="radio" name="arch" id="arch" value="ppc64">ppc64 #end if + #if $repo and $repo.arch == "s390" + <input type="radio" name="arch" id="arch" value="s390" checked>s390 + #else + <input type="radio" name="arch" id="arch" value="s390">s390 + #end if #if $repo and $repo.arch == "s390x" <input type="radio" name="arch" id="arch" value="s390x" checked>s390x #else @@ -238,6 +243,19 @@ function disablename(value) #else <input type="radio" name="arch" id="arch" value="ia64">ia64 #end if + #if $repo and $repo.arch == "noarch" + <input type="radio" name="arch" id="arch" value="noarch" checked>noarch + #else + <input type="radio" name="arch" id="arch" value="noarch">noarch + #end if + #if $repo and $repo.arch == "src" + <input type="radio" name="arch" id="arch" value="src" checked>src + #else + <input type="radio" name="arch" id="arch" value="src">src + #end if + + + <p class="context-tip">What architecture is the repo?</p> </td> </tr> |