Bug 1691436
| Summary: | hammer help --organization-id should be "Set the current location context for the request" | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Nithin Thomas <nitthoma> |
| Component: | Hammer | Assignee: | Oleh Fedorenko <ofedoren> |
| Status: | CLOSED ERRATA | QA Contact: | Mirek Długosz <mzalewsk> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.6.0 | CC: | apatel, dhlavacd, egolov, ehelms, kgaikwad, mbacovsk, mshira, ofedoren, rabajaj |
| Target Milestone: | 6.8.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | hammer-cli-foreman-2.1.2 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-10-27 13:32:10 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
2019-03-21 15:35:42 UTC
--organiztion_id will set the current organization context for the request. if you want to set an organization, you should --organization-ids hammer location create --name Test2 --organization-ids "2" which will Associated organization IDs. however, the hammer --help doesn't explain that very well, so I'm changing the title of the PR to change the help message Created redmine issue https://projects.theforeman.org/issues/28869 from this bug Upstream bug assigned to mshira organization_id can be a bit confusing, Normally you would expect to set the organization but it's not the case. organization_id can only set the scope of the request. like, In the UI, you have those two buttons of the location and organization, and they are setting the scope of all foreman actions... organization_id will not set the organization just the scope of it. so I believe that the best approach here is to change the help because it could be a bit confusing. If you want to set the organization, you could use --organization-ids Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28869 has been resolved. Thank you @Shira The new option available in satellite 6.7 will add the location to the organization while creating. # hammer location create --help --organization-ids ORGANIZATION_IDS Associated organization IDs # hammer location create --name Test --organization-ids 1 # hammer location list --organization-id 1 ---|----------|----------|------------ ID | TITLE | NAME | DESCRIPTION ---|----------|----------|------------ 4 | xxxxxxxx | xxxxxxxx | 6 | Test | Test | 2 | xxxx | xxxx | ---|----------|----------|------------ As of 6.8 snap 5, --help message is even more confusing than it used to be:
#v+
$ hammer location create --help
...
--organization[-id|-title] Name/Title/Id of associated organization
--organization[s|-ids|-titles] Associated organization Names/Titles/Ids
Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
JSON is acceptable and preferred way for complex parameters
#v-
Both --organization-id and --organization-ids use "associated organization" wording, suggesting these options are equivalent. But they are not, since only --organization-ids actually assign organization to location:
#v+
$ hammer location create --name 'test-loc' --organization-id 3
$ hammer location list --organization-id 3
---|------------------|------------------|------------
ID | TITLE | NAME | DESCRIPTION
---|------------------|------------------|------------
2 | Default Location | Default Location |
---|------------------|------------------|------------
$ hammer location create --name 'test-loc2' --organization-ids 3
$ hammer location list --organization-id 3
---|------------------|------------------|------------
ID | TITLE | NAME | DESCRIPTION
---|------------------|------------------|------------
2 | Default Location | Default Location |
5 | test-loc2 | test-loc2 |
---|------------------|------------------|------------
#v-
Tested on:
Satellite 6.8.0 snap 5
pulp-server-2.21.2-1.el7sat.noarch
satellite-6.8.0-0.4.beta.el7sat.noarch
foreman-2.1.0-0.20.rc2.el7sat.noarch
katello-3.16.0-0.3.rc1.el7sat.noarch
tfm-rubygem-hammer_cli-2.1.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-2.1.1-1.el7sat.noarch
Connecting redmine issue https://projects.theforeman.org/issues/30182 from this bug As of 6.8 snap 9, --help message makes it clear that --organization and --organizations are not equivalent:
#v+
$ hammer location create --help
...
--organization[-id|-title] Set the current organization context for the request. Name/Title/Id can be used
--organization[s|-ids|-titles] Associated organization Names/Titles/Ids
Comma separated list of values. Values containing comma should be quoted or escaped with backslash.
JSON is acceptable and preferred way for complex parameters
...
#v-
Tested on:
Satellite 6.8 snap 9
rpm -foreman-2.1.0-1.el7sat.noarch
pulp-server-2.21.2-1.el7sat.noarch
katello-3.16.0-0.4.rc4.el7sat.noarch
satellite-6.8.0-0.7.beta.el7sat.noarch
tfm-rubygem-hammer_cli-2.1.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-2.1.2-1.el7sat.noarch
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 (Satellite 6.8 Satellite Tools 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/RHBA-2020:4367 |