Bug #30418
openForeman WebUI does not like Locations without an Organization
Description
Details: Foreman 2.1.0 EL8 Repo on CentOS 8.2
Note: This issue is for your information, and not affecting any real deployment, but it is a bug!
I was exploring the hammer(1) CLI and noticed that new entities like organizations and locations get registered against all other entity types like Media, Provisioning Templates, etc; this can be seen in the WebUI's "Administer" -> "Organizations" and "Locations". This is desirable behaviour, saving the user from having to associate these things with newly created Organizations and Locations (and likely etc, ... - untested).
So I was considering how using the hammer(1) CLI to register locations in a multi-organization and multi-location setup for my write up. This lead to testing the option '--ignore-types', as follows, this new location can be listed via the hammer(1) CLI, and is listed with my initial organization.
hammer location create --name 'Fictitious Location' --description '' --ignore-types organization Location created. hammer location list ... 5 | Fictitious Location | Fictitious Location | ... hammer location info --id 5 .... Organizations: {{My initial organization}} ....
Aside: the following is invalid, as expected.
hammer location create --name 'Fictitious Location - Empty' --description '' --organization-title '' Could not create the location: Error: organization not found.
THE PROBLEM: WebUI Administer => Locations, Click on 'Fictitious Location', and the result is:
In a red box "Oops, we're sorry but something went wrong wrong constant name organization"
Upto the first wrong is in bold, after that the text is not bold. A 'Back' button and other general test completes the page.
Aside: I would suggest adding a colon ':' after the first bold wrong, to improve the readability of the message.
Updated by Peter Bray almost 5 years ago
Aside: The hammer(1) CLI help for this option --ignore-types IGNORE_TYPES, for 'organization', 'location' (and likely others) is as follows:
List of resources types that will be automatically associated Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
Surely, that first sentence needs to be changed, say from 'will be' to 'will not be' if the option name correctly reflects the action to be undertaken with the provided arguments.