Project

General

Profile

Actions

Bug #15647

closed

Hammer hostgroup create insist on lifecycle environment

Added by Andrew Kofink over 8 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Hammer
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1354462
REGRESSION (was working in pre-15 drops)

BLOCKER (unable to create hostgroup via CLI -> no provisioning)

Some recent change broke hammer cli command:

[root@hp-bl465cg7-01 ~]# hh hostgroup create --name "CentOS 7.0" --architecture x86_64 --domain nested.lan --subnet nested.lan --operatingsystem "CentOS 7.0" --medium mirror_centos --partition-table "Kickstart simple" --puppet-proxy-id 1 --puppet-ca-proxy-id 1 --environment production --root-pass "$PASS$PASS$PASS" --organizations "$ORG" --locations "$LOC"
Could not create the hostgroup:
Error: lifecycle_environment not found

This was previously working. Now, the problem is it does not respect lifecycle-environment option which was added:

[root@hp-bl465cg7-01 ~]# hh hostgroup create --name "CentOS 7.0" --architecture x86_64 --domain nested.lan --subnet nested.lan --operatingsystem "CentOS 7.0" --medium mirror_centos --partition-table "Kickstart simple" --puppet-proxy-id 1 --puppet-ca-proxy-id 1 --environment production --root-pass "$PASS$PASS$PASS" --organizations "$ORG" --locations "$LOC" --lifecycle-environment "TestEnv"
Could not create the hostgroup:
Error: lifecycle_environment not found

You can't provide even numeric ID - all is ignored. Debug mode reveals that due to typo in the codebase perhaps, the CLI tries to search Katello environments via --environment (puppet) option:

[ INFO 2016-07-11 07:34:01 API] GET /katello/api/organizations/1/environments
[DEBUG 2016-07-11 07:34:01 API] Params: {
"name" => "production"
}
[DEBUG 2016-07-11 07:34:01 API] Headers: {
:params => {
"name" => "production"
}
}
[DEBUG 2016-07-11 07:34:01 API] Response: {
"total" => 0,
"subtotal" => 0,
"page" => 1,
"per_page" => 20,
"error" => nil,
"search" => nil,
"sort" => {
"by" => nil,
"order" => nil
},
"results" => []
}

The query is "production" while I expect it to be "TestEnv".

This bug is unfortunate as it blocks automated CLI installation and setup of provisioning. Hostgroup is a must in provisioning setups (for activation key).


Related issues 3 (0 open3 closed)

Related to Foreman - Bug #14686: hammer hostgroup update or create command fails when using --organization-ids option failsClosedAndrew Kofink04/18/2016Actions
Related to Katello - Bug #15701: Allow Foreman objects to resolve using `create_search_options_creators_without_katello_api`ClosedAndrew Kofink07/15/2016Actions
Blocked by Katello - Bug #15672: Do not require organization_id when searching in content_views#index and katello/environments#indexClosedAndrew Kofink07/12/2016Actions
Actions

Also available in: Atom PDF