Bug 1359694
| Summary: | Hostgroup create/update doesn't allow to set list of organizations | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Stanislav Tkachenko <stkachen> |
| Component: | Content Management | Assignee: | Andrew Kofink <akofink> |
| Status: | CLOSED ERRATA | QA Contact: | sthirugn <sthirugn> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.2.0 | CC: | akofink, bbuckingham, bkearney, inecas, mbacovsk, mmccune, oshtaier, sghai, sthirugn, zhunting |
| Target Milestone: | Unspecified | Keywords: | Regression, Triaged |
| Target Release: | Unused | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | tfm-rubygem-hammer_cli_katello-0.0.22.25-1 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-08-16 07:11:41 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
Stanislav Tkachenko
2016-07-25 10:14:44 UTC
Is this generic hammer or content specific bug? This is a hammer specific bug as we can add multiple organizations to hostgroup through both API and WebUI. We could do that from hammer too, but not now @inecas, this is content specific hammer bug related to changes mentioned in c#1. The user can still associate organizations with a hostgroup via the CLI; however, it must be done using the --organization-ids (or --organizations) parameters. The use of --organization-id (or --organization) is reserved for use when --lifecycle-environment is included, to support resolving the specific environment.
The following are a few examples:
SCENARIO 1: (valid)
-----------
hammer> hostgroup create --name groupA --organization-ids 1,3
Hostgroup created
hammer> hostgroup info --name groupA
Id: 6
Name: groupA
Title: groupA
Puppet CA Proxy Id:
Puppet Master Proxy Id:
Puppetclasses:
Parameters:
Organizations:
Default Organization
org2
Parent Id:
SCENARIO 2: (valid)
-----------
hammer> hostgroup create --name groupB --organization-ids 1,3 --lifecycle-environment dev --organization-id 1
Hostgroup created
hammer> hostgroup info --name groupB
Id: 7
Name: groupB
Title: groupB
Puppet CA Proxy Id:
Puppet Master Proxy Id:
Puppetclasses:
Parameters:
Organizations:
Default Organization
org2
Parent Id:
SCENARIO 3: (error expected; however, error text should indicate --organization or --organization id
-----------
hammer> hostgroup create --name groupC --organization-ids 1,3 --lifecycle-environment dev
Could not create the hostgroup:
Error: Could not find organization, please set one of options --organizations, --organization-ids.
hammer>
SCENARIO 4: (valid alternative, specifying lifecycle environment id)
-----------
hammer> hostgroup create --name groupC --organization-ids 1,3 --lifecycle-environment-id 3
Hostgroup created
hammer>
Based on the above, the command is working as expected in Satellite 6.2; however, the error message for SCENARIO 3 needs to be updated to reflect the correct parameters. We'll work on addressing that with this bug.
Verified in satellite-6.2.0-21.2.el7sat.noarch. Works in the same way as explained in Comment 8. bbuckingham++ for taking time to explain all the valid/error scenarios - great documentation! hammer> hostgroup create --name hostgroup1 --organization-ids 1,3 Hostgroup created hammer> hostgroup info --name hostgroup1 Id: 4 Name: hostgroup1 Title: hostgroup1 Puppet CA Proxy Id: Puppet Master Proxy Id: Puppetclasses: Parameters: Organizations: Default Organization testorg1 Parent Id: hammer> hostgroup create --name hostgroup2 --organization-ids 1,3 --lifecycle-environment QE --organization-id=1 Hostgroup created hammer> hostgroup info --name hostgroup2 Id: 5 Name: hostgroup2 Title: hostgroup2 Puppet CA Proxy Id: Puppet Master Proxy Id: Puppetclasses: Parameters: Organizations: Default Organization testorg1 Parent Id: hammer> hostgroup create --name hostgroup3 --organization-ids 1,3 --lifecycle-environment QE [ERROR 2016-08-05 14:36:14 Exception] Error: At least one of options --organization-id, --organization is required See: ' hostgroup create --help' Could not create the hostgroup: Error: At least one of options --organization-id, --organization is required See: ' hostgroup create --help' hammer> hostgroup create --name hostgroup3 --organization-ids 1,3 --lifecycle-environment-id=2 Hostgroup created hammer> hostgroup info --name hostgroup3 Id: 6 Name: hostgroup3 Title: hostgroup3 Puppet CA Proxy Id: Puppet Master Proxy Id: Puppetclasses: Parameters: Organizations: Default Organization testorg1 Parent Id: 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/RHBA-2016:1615 |