Edit hosts page not reflecting correct selections.
1. Create a CV called RHEL7 with only a RHEL 7.9 kickstart repository and promote to an Environment called CYCLE-A
2. Create a CV called RHEL8 with only a RHEL 8.3 BaseOS\Appstream kickstart repository and Promote to and environment called CYCLE-B.
3. Create a hostgroup called "Blank" with * NO * CV\LCE\Content Source\OS selected. You can add puppet modules and select puppet\ansible related stuff in this hostgroup.
4. Create a hostgroup called "RHEL" which is child of "Blank" and have "RHEL7" selected as CV and CYCLE-A selected as LCE, content source selected as Satellite, in OS page, correct media selection/synced media/OS/arch selected for RHEL 7.9.
5. Now create a host with the "RHEL" hostgroup but manually change the CV\LCE to RHEL8\CYCLE-B and in OS tab, manually select correct media selection/synced media/OS/arch for RHEL8. Submit the changes and now the host should be in build mode.
6. Edit back the host,
I should see the Rhel 8 cv.
- On the first page, The CV has switched back to RHEL7 whereas we had selected RHEL8 CV at step 5. And the same goes for LCE i.e. it got switched back to CYCLE-B.
- Go to OS tab and we will see that,
--> OS itself is selected the same we had set at Step 5 during host creating. So this part is still good But,
--> Media Selection is moved to "All Media" and is greyed out .
--> No "Synced Media" Selected.
Prior to this commit `Edit Host` would give a preference to the values
of the associated hostgroup (this was only in display.)
This meant if you created a host with a hostgroup and changed things
like LCE/CV/kickstart repository id etc those overrides
would not correctly get reflected when Editing the host. It would only
show what was in the hostgroup attached to the host.
This fix magically solves that issue by making it corrently look at
the host and hostgroup.