Bug #32377
openhammer location list does not show a nested location
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1937009
Description of problem:
hammer location list does not show a nested location
Version-Release number of selected component (if applicable):
How reproducible:
100%
Steps to Reproduce:
1. Create the parent location(Parent_Loc)
2. Create a location with a parent location(Nested_Loc)
3. Run 'hammer location list'
Actual results:
The hammer output will show only the parent location
Eg.:
hammer location list --organization Org1
---|------------|------------|------------
ID | TITLE | NAME | DESCRIPTION
---|------------|------------|------------
65 | Parent_Loc | Parent_Loc |
---|------------|------------|------------
hammer location info --name Nested_Loc --organization Org1 |grep ^Parent
Parent: Parent_Loc
Expected results:
Since the nested location inherits the org from the parent location, we would expect to see the nested location in the 'hammer location list' output.
Additional info:
On Satellite webUI -> Administer -> Locations -> Click on the nested location -> Organizations
hover the mouse on the org name, it says 'This is inherited from parent'
However, if we go to:
Satellite webUI -> Administer -> Organisations -> Click on the Org -> Locations
We see the nested org is not part of the Organization.
I am not sure if this is a bug on the webUI or a bug in hammer location list
command.
Once the nested location is added to the Org(Satellite webUI -> Administer -> Organisations -> Click on the Org -> Locations), it will appear in the hammer output.
Updated by Oleh Fedorenko about 3 years ago
Note: it seems that when you create a nested location, its parent's organization is not being explicitly set for the nested location. This can lead to such bugs if you try to use search, e.g. --organization "Parent's".
Not a bug in hammer, but I'd say it's in searching or assigning/inheriting.