Bug 1337947
Summary: | hammer ignores location-id if organization-id is specified | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Peter Vreman <peter.vreman> |
Component: | Organizations and Locations | Assignee: | Ivan Necas <inecas> |
Status: | CLOSED ERRATA | QA Contact: | Peter Ondrejka <pondrejk> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.2.0 | CC: | bbuckingham, bkearney, brubisch, inecas, jcallaha, xdmoon |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 16:54:17 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832 |
Description
Peter Vreman
2016-05-20 14:06:48 UTC
I see that in the API request URL there is a '/api/locations/999999/environments' That means the errors are: - Server does not check URL paramters (e.g. location_id) for validity - Server shall returns empty result as there is no environment associated with location 999999 Might be related to https://bugzilla.redhat.com/show_bug.cgi?id=1257586 that is for the UI Created redmine issue http://projects.theforeman.org/issues/15174 from this bug It seems the fix should be trivial, I've opened a pr https://github.com/theforeman/foreman/pull/3549 Upstream bug assigned to inecas Upstream bug assigned to inecas Patch https://github.com/theforeman/foreman/pull/3549 confirmed to work [crash] root@li-lc-1578:~# hammer -c/opt/hoici/etc/sat6/hammer-hoici.yaml environment list --organization-id=3 --location-id=999999 Location with id 999999 not found Moving to POST since upstream bug http://projects.theforeman.org/issues/15174 has been closed Tested in Satellite 6.3 snap 5, various combinations of organization and location settings now resolve correctly when listing environments: [root@4-example ~]# hammer environment list --organization "Default Organization" ---|---------------------------------------------- ID | NAME ---|---------------------------------------------- 6 | in_Deforg 9 | in_deforg_testloc 5 | KT_Default_Organization_Library_capsuleview_2 2 | KT_Default_Organization_Library_foo_3 ---|---------------------------------------------- [root@4-example ~]# hammer environment list --organization "Default Organization" --location testloc ---|------------------ ID | NAME ---|------------------ 9 | in_deforg_testloc ---|------------------ [root@4-example ~]# hammer environment list --location testloc ---|------------------ ID | NAME ---|------------------ 9 | in_deforg_testloc 8 | in_testloc ---|------------------ However, Hammer doesn't complain if organization is specified twice, e.g.: [root@4-example ~]# hammer environment list --organization "Default Organization" --organization "sillycorp" ---|------------- ID | NAME ---|------------- 7 | in_sillycorp The output could be misunderstood as being in both orgs, while in fact hammer just accepts the last specified org. Ivan, do you prefer a separate BZ for this? (In reply to Peter Ondrejka from comment #14) > Ivan, do you prefer a separate BZ for this? Never mind, I found out there is already for this issue (http://projects.theforeman.org/issues/16206) Moving to verified as per comment #14 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:0336
|