Bug 1127595
Summary: | Global PXE Menu hostgroup name shall be first in menu label and also sort menu labels | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> |
Component: | Provisioning Templates | Assignee: | Lukas Zapletal <lzap> |
Status: | CLOSED ERRATA | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0.3 | CC: | afeferku, brubisch, cwelton, lzap, peter.vreman, pgagne |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://projects.theforeman.org/issues/6977 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 16:54:17 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832 |
Description
Peter Vreman
2014-08-07 08:28:32 UTC
Created redmine issue http://projects.theforeman.org/issues/6977 from this bug Patch to sort the entries: patch -p0 -l -f << EOF --- /usr/share/foreman/app/models/config_template.rb +++ /usr/share/foreman/app/models/config_template.rb @@ -197,6 +197,7 @@ end end end + combos.sort! { |x,y| "#{x[:hostgroup]} - #{x[:template]}" <=> "#{y[:hostgroup]} - #{y[:template]}" } combos end end EOF Patch for the template: patch -p0 -l -f << EOF --- /usr/share/foreman/app/views/unattended/pxe/PXELinux_default.erb +++ /usr/share/foreman/app/views/unattended/pxe/PXELinux_default.erb @@ -18,11 +18,12 @@ LOCALBOOT 0 <% for profile in @profiles -%> -LABEL <%= "#{profile[:template]} - #{profile[:hostgroup]}" %> +LABEL <%= "#{profile[:hostgroup]} - #{profile[:template]}" %> kernel <%= profile[:hostgroup].operatingsystem.kernel(profile[:hostgroup].architecture) %> <% case profile[:hostgroup].operatingsystem.pxe_type -%> <% when 'kickstart' -%> append initrd=<%= profile[:hostgroup].operatingsystem.initrd(profile[:hostgroup].architecture) %> ks=<%= default_template_url(profile[:template], profile[:hostgroup]) %> ksde$ + ipappend 2 <% when 'preseed' -%> append initrd=<%= profile[:hostgroup].operatingsystem.initrd(profile[:hostgroup].architecture) %> interface=auto url=<%= default_template_url(profile[:template], profile[:hos$ <% end -%> EOF Upstream bug component is Provisioning Templates Moving to POST since upstream bug http://projects.theforeman.org/issues/6977 has been closed The upstream patch is not correct. It sorts on the hostgroup name instead of the full hostgroup title Working patch against 6.2.2 --- /usr/share/foreman/app/models/provisioning_template.rb +++ /usr/share/foreman/app/models/provisioning_template.rb @@ -188,6 +188,6 @@ def self.pxe_default_combos end end end - combos + combos.sort_by! { |profile| [profile[:hostgroup].title, profile[:template]] } end end EOF For testing use nested hostgroups, for example: dev/Cluster1/Database dev/Cluster1/WebServer prod/Cluster1/Database prod/Cluster1/WebServer The output shall be like the list above A new upstream bug fix has been close - https://github.com/theforeman/foreman/pull/3982 VERIFIED order is correct. LABEL A_RHEL 7.3 HGP - A Kickstart KERNEL boot/CentOS-7.3-x86_64-vmlinuz APPEND initrd=boot/CentOS-7.3-x86_64-initrd.img ks=http://xxx.redhat.com/unattended/template/A%20Kickstart/A_RHEL%207.3%20HGP ksdevice=bootif network kssendmac ks.sendmac inst.ks.sendmac LABEL RHEL 7.3 HGP - A Kickstart KERNEL boot/CentOS-7.3-x86_64-vmlinuz APPEND initrd=boot/CentOS-7.3-x86_64-initrd.img ks=http://xxx.redhat.com/unattended/template/A%20Kickstart/RHEL%207.3%20HGP ksdevice=bootif network kssendmac ks.sendmac inst.ks.sendmac Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
>
> For information on the advisory, and where to find the updated files, follow the link below.
>
> If the solution does not work for you, open a new bug report.
>
> https://access.redhat.com/errata/RHSA-2018:0336
|