Bug 1564740

Summary: Unable to override hostgroup parameters from All hosts => edit host on WebUI
Product: Red Hat Satellite Reporter: Nithin Thomas <nitthoma>
Component: Host FormAssignee: Daniel Lobato Garcia <dlobatog>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: ahumbe, akaiser, bkearney, david.koczorowski, dlobatog, ehelms, gapatil, inecas, kgaikwad, mayadav, mhulan, mjia, mmccune, molasaga, nitthoma, pcreech, pierre-yves.goubet, rabajaj, rproffit, sgraessl, sthirugn, tbrisker, vgunasek, walden, yferszt
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1624025 (view as bug list) Environment:
Last Closed: 2018-10-16 19:26:27 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:

Description Nithin Thomas 2018-04-07 09:53:45 UTC
Description of problem:

when we click on "edit host" from all hosts. edit page showing the default settings with respect to the selected hostgroup. Any change in the parameters does not reflect on WebUI. However, hammer shows updated details.

Version-Release number of selected component (if applicable):

- Satellite 6.3

How reproducible:

- Always

Steps to Reproduce:

1. provision a host with hostgroup
2. change the LE/CV or content-source fromWebUI and save it
3. click on edit host again and LE/CV changed to the default one in the hostgroup

Actual results:

- edit page showing values from hostgroup after changing 

Expected results:

- changes should be visible on WebUI

Additional info:

- hammer host info shows correct values
- only reproducible in 6.3
- reproducer details added

Comment 2 Tomer Brisker 2018-04-09 10:11:18 UTC
This appears to be a bug in the host form. Changing the values from the hostgroup defaults in the form and saving saves the new values, but when opening the form again the hostgroup defaults are repopulated in these fields. @walden - any idea on why this happens?

Comment 5 Walden Raines 2018-05-01 02:40:06 UTC
(In reply to Tomer Brisker from comment #2)
> This appears to be a bug in the host form. Changing the values from the
> hostgroup defaults in the form and saving saves the new values, but when
> opening the form again the hostgroup defaults are repopulated in these
> fields. @walden - any idea on why this happens?

No I don't, I'm sorry.  I don't know much about foreman's forms unfortunately.

Comment 12 Daniel Lobato Garcia 2018-05-25 11:36:41 UTC
Created redmine issue http://projects.theforeman.org/issues/23706 from this bug

Comment 13 Daniel Lobato Garcia 2018-05-28 09:25:40 UTC
I can successfully reproduce the error on the latest nightly version of Katello + Foreman. Working on a fix for this now.

Comment 14 Daniel Lobato Garcia 2018-05-28 10:05:06 UTC
Alright, after some investigation I found this issue is quite interesting:

1 - We have a host with a Host Group. Then we decide to override the Lifecycle Environment and Content View. Fine, just go to the edit form and change them.
2 - Submit the form - everything should be OK. (in fact it is at this point)
3 - We reopen the edit form to make sure the changes were applied but surprise: Lifecycle Environment and Content View are set back to the Host Group ones. Or.. is that true? No! It's just an UI bug.

After you submit the form, the data is saved properly on your database. For example:

Host A is inheriting LE with name 'test-le' and CV with name 'test-cv'.
We edit the form with LE with name 'production-le' and CV with name 'production-cv'. Submit. 
We check using the API, /api/v2/hosts/A - and the data is fine!
However if we open the form, we will see LE 'test-lv' and CV 'test-cv'. This is NOT what's on the database, and it's misleading. Especially if you press the submit button again by mistake, you'll actually change the values for good, when you actually wanted 'production-le' and 'production-cv'.

I will fix this ASAP, however keep in mind and please inform customers that their changes are being applied properly. The problem is just that the UI is not displaying it right. You may verify this using the API if you wish.

Comment 16 Daniel Lobato Garcia 2018-05-28 12:24:52 UTC
Patch under review upstream at https://github.com/Katello/katello/pull/7398

Comment 23 sthirugn@redhat.com 2018-06-14 17:32:01 UTC
*** Bug 1591405 has been marked as a duplicate of this bug. ***

Comment 27 Andrew Kofink 2018-07-13 13:35:04 UTC
*** Bug 1585529 has been marked as a duplicate of this bug. ***

Comment 28 Satellite Program 2018-07-13 16:22:45 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/23706 has been resolved.

Comment 33 Daniel Lobato Garcia 2018-07-19 11:37:29 UTC
*** Bug 1578321 has been marked as a duplicate of this bug. ***

Comment 34 Peter Ondrejka 2018-07-25 14:12:39 UTC
Verified on Sat 6.4 snap 13, changes to hostgroup-inherited parameters of existing hosts are correctly reflected in the UI after saving and reviewing.

Comment 36 Mahesh Yadav 2018-10-02 10:49:07 UTC
*** Bug 1635193 has been marked as a duplicate of this bug. ***

Comment 39 Bryan Kearney 2018-10-16 19:26:27 UTC
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:2927