Bug #15647
closedHammer hostgroup create insist on lifecycle environment
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).