Actions
Bug #24060
closedhammer host create using wrong API endpoint to list environments
Difficulty:
Triaged:
Bugzilla link:
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1583597
Description of problem:
`hammer host create` accepts a --environment parameter (which is supposed to be a puppet environment). However, on specifying this, it uses the API endpoint of katello environments, which are lifecycle environments:
# hammer -d -u admin -p changeme --output=csv host create --medium-id="31" --ip="142.89.31.218" --location-id="2" --operatingsystem-id="2" --environment="KT_QrEczI_Library_pTBRPfBmGb_168" --domain-id="18" --partition-table-id="91" --mac="86:fa:fa:27:ef:0a" --organization-id="127" --architecture-id="1" --name="GkhWDIhihR" --puppet-classes="generic_1" --root-password="vERLTilA" ... ... [ INFO 2018-05-29T06:34:03 API] GET /katello/api/organizations/127/environments [DEBUG 2018-05-29T06:34:03 API] Params: { "name" => "KT_QrEczI_Library_pTBRPfBmGb_168" } [DEBUG 2018-05-29T06:34:03 API] Headers: { :params => { "name" => "KT_QrEczI_Library_pTBRPfBmGb_168" } } [DEBUG 2018-05-29T06:34:03 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth [DEBUG 2018-05-29T06:34:03 API] Response: { "total" => 0, "subtotal" => 0,
This obviously always fails to create a host if the --environment parameter is specified.
the correct endpoint to be queried is:
/api/v2/organizations/<id>/environments
How reproducible:
always
Steps to Reproduce:
1. try to create a host using hammer with specifying an --environment parameter
Updated by Ivan Necas over 6 years ago
- Related to Bug #22517: Can't create a hostgroup, organization error added
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ivan Necas
- Pull request https://github.com/Katello/hammer-cli-katello/pull/566 added
Updated by Ivan Necas over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset hammer-cli-katello|49b48b3c1d431da10c254e3c59e62552cb909122.
Updated by Andrew Kofink over 6 years ago
- Subject changed from hammer host create using wrong API endpoint to list environments to hammer host create using wrong API endpoint to list environments
- Translation missing: en.field_release set to 338
Actions