Bug 2058649

Summary: Unable to set or unset "Discovery location" settings from UI of Satellite 7.0 but the same is partly feasible via hammer_cli.
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Discovery PluginAssignee: Ondřej Ezr <oezr>
Status: CLOSED ERRATA QA Contact: Griffin Sullivan <gsulliva>
Severity: high Docs Contact:
Priority: high    
Version: 6.11.0CC: apatel, ehelms, lzap, mhulan, oezr, rabajaj
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rubygem-foreman_discovery-19.0.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:33:57 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 Sayan Das 2022-02-25 14:21:39 UTC
Description of problem:

In Satellite 7.0, After going into Administer --> Settings --> Discovered tab, We can only set or unset Discovery Organization properly.

But we cannot set "Discovery Location" even after selecting the location and then submitting the same. It's possible to do via hammer but from UI, we cannot unset it either.



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

satellite-7.0.0-0.5.beta.el8sat.noarch
foreman-3.1.1.6-1.el8sat.noarch

How reproducible:

Always

Steps to Reproduce:
1. Install Satellite 7.0 on RHEL 8, with first organization name set as RedHat and location name set as GSS

2. Go to Administer --> Settings --> Discovered tab of Satellite UI and try to set the "Discovery Location" and "Discovery Organization" options.

3. Come back to the command line and verify the changes.

4. Try to set the discovery_location via hammer

5. From Administer --> Settings --> Discovered tab of Satellite UI and try to unset the "Discovery Location" and "Discovery Organization" options.

6. Try to unset the discovery_location via hammer



Actual results:

2) Was able to set Discovery Org to RedHat but even after selecting and submitting the GSS location for discovery location, the value is not accepted or remains blank. 

3) Nothing set as the discovery_location

# hammer settings list --search "name = discovery_location"
-------------------|--------------------|-------|--------------------------------------------------
NAME               | FULL NAME          | VALUE | DESCRIPTION                                      
-------------------|--------------------|-------|--------------------------------------------------
discovery_location | Discovery location |       | The default location to place discovered hosts in
-------------------|--------------------|-------|--------------------------------------------------


4) Successfully did the same for the discovery location using hammer cli.

# hammer settings set --name discovery_location --value GSS
Setting [discovery_location] updated to [GSS].

# hammer settings list --search "discovery_location"
-------------------|--------------------|-------|--------------------------------------------------
NAME               | FULL NAME          | VALUE | DESCRIPTION                                      
-------------------|--------------------|-------|--------------------------------------------------
discovery_location | Discovery location | GSS   | The default location to place discovered hosts in
-------------------|--------------------|-------|--------------------------------------------------


5) While trying to unset "Discovery Organization" it offers to choose a null value from dropdown and allows to unset the setting but for "Discovery Location" no such options are present. I simply can't unset it.


6) Again, via CLI that is possible. 

# hammer settings set --name discovery_location --value ''
Setting [discovery_location] updated to [].

# hammer settings list --search "discovery_location"
-------------------|--------------------|-------|--------------------------------------------------
NAME               | FULL NAME          | VALUE | DESCRIPTION                                      
-------------------|--------------------|-------|--------------------------------------------------
discovery_location | Discovery location |       | The default location to place discovered hosts in
-------------------|--------------------|-------|--------------------------------------------------



Expected results:


UI should behave in exact same way for "Discovery Location" as it is behaving for the "Discovery Organization" option. 


Additional info:

For Satellite 7.0 only the discovery_location is broken but for Satellite 6.10, both Discovery Organization and Location settings are broken i.e. cannot be set or unset from UI.

Comment 1 Sayan Das 2022-02-26 16:02:26 UTC
Small correction in the Discovery Organization part.

Seems like the UI of 7.0,  only allows two options for the Organization selection part i.e. a Blank selection or the first Organization created during installation of satellite , When there are more than one organization present.

Comment 7 Bryan Kearney 2022-03-25 12:05:08 UTC
Upstream bug assigned to oezr

Comment 8 Bryan Kearney 2022-03-25 12:05:10 UTC
Upstream bug assigned to oezr

Comment 13 Bryan Kearney 2022-03-31 20:05:40 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34678 has been resolved.

Comment 14 Lukas Zapletal 2022-04-08 08:31:43 UTC
Pushed out upstream-only release with this patch: 19.0.3. Please update, thanks.

Comment 24 errata-xmlrpc 2022-07-05 14:33:57 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 (Moderate: Satellite 6.11 Release), 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-2022:5498