Bad inheritance of Architecture property is causing Grayed out media selections for child hostgroup
The value selected in "Architecture" is not properly inherited by Child Hostgroup and results in grayed-out values for Media even if the correct OS\CV\LCE\Content_Source is selected.
Steps to Reproduce:
1. Sync RHEL 7.9 kickstart and RHEL 6.10 kickstart
2. Create Host Group Called "Content" and set LCE\CV\Content Source on the same. In the operating system tab, Only select x86_64 architecture.
3. Create another Host group called "RHEL" and then select "Content" as it's parent.
4. Go to Operating Systems tab and see the value for "Architecture" selected.
5. Select "RedHat 7.9" as the "Operating system" and observer the "Media Selection" and "Media" options\fields
Step 4 will show "Inherited Parent (x86_64)" for Architecture field.
Step 5 will result is Grayed out fields for "Media Selection" and "Media"
Now, if we click on "Architecture" field and then select "x86_64" manually and then re-select the OS as "RedHat 7.9", the "Synced Media" gets selected and "Media" field gets filled with kickstart repo info.
Should be able to inherit the Architecture and use it inside a Nested Hostgroup while OS is being selected on the child group.
- This issue is not only noticed when we select "Architecture" on the parent group and the OS in the child group.
- If I select both Architecture and OS in the parent group, then
- Inheritance of those properties will look fine in Child Group "RHEL" including "Synced Media" and "Media" Selections and I can safely submit the Child Group settings as well.
- But as soon as I edit it back and try to change the OS to something else i.e. "RedHat 6.10" in the child group, It will result in Grayed out fields for "Media Selection" and "Media" again unless I select "x86_64" manually in the child group as the Arch.
Before the PR -
On create hostgroups page the inheritance hierachy behavior was different
between katello attribute like content_view/lce/content source etc vs
things like os and arch
For example if you create a child hostgroup and ppointed to a parent
with contnet view, you would see the cv automatically selected as the
default, instead of 'Inherit Content View' as os/arch fields behave.
More over if you had cv, lce, cs, arch filled in the parent hostgroup
and enabled operating system in the child the media section would not
get automatically populated (because the notion of parent_id was
Both the above cases behave appropriately.