Project

General

Profile

Actions

Bug #33381

closed

hammer `host create --puppet-classes` generates incorrect API query

Added by Chris Roberts over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer
Target version:
Difficulty:
trivial
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description of problem:
multiple puppet inconsistencies in sat 6.10, blocks host update action

Version-Release number of selected component (if applicable):
sat 6.10, tested with snap 8,9,10

How reproducible:
Always

Steps to Reproduce:
ON satellite:
1. download two puppet modules
curl -O http://infra-robottelo-fixtures.infra.sat.rdu2.redhat.com:50123/custom_puppet/system/releases/r/robottelo/robottelo-api_test_classparameters-0.2.0.tar.gz
curl -O http://infra-robottelo-fixtures.infra.sat.rdu2.redhat.com:50123/custom_puppet/system/releases/r/robottelo/robottelo-generic_1-0.2.0.tar.gz
2. install them with target-dir env_1 and env_2
puppet module install robottelo-api_test_classparameters-0.2.0.tar.gz --target-dir /etc/puppetlabs/code/environments/env_1/modules/
puppet module install robottelo-generic_1-0.2.0.tar.gz --target-dir /etc/puppetlabs/code/environments/env_2/modules
e.g in UI:
3. Configure -> Import Environments -> env_1 and env_2
4. create new location and organization (new_org, new_location)
5. update environments env_1 and env_2, only location and organization they have is the new one
6. preparation for host creation, all entities are associated only with new location and org
a) create domain (testdomain)
b) create installation medium, (test_media) path e.g. http://abc
c) satellite has one of the architecture, os and partition table, in case you don't have it create it
d) update os with new medium

in CLI:
7. create host,
(first PROBLEM: has to be done in API/CLI, UI do not allow to assign the puppet class parameters)
example of creation:
hammer host create --name='host' --architecture-id=1 --environment='env_1' --domain='testdomain' --ip='1.2.3.4' --mac='aa:bb:cc:dd:ee:ff' --medium='test_media' --operatingsystem-id=1 --organization='new_org' --location='new_location' --puppet-classes='api_test_classparameters' --partition-table='Kickstart default' --root-password='test_password'

8. create new user (new_user)
9. update host with new user
hammer host update --name='host.testdomain' --owner='new_user' --owner-type='User'

Note: it doesn't matter which update action is done, update action always end up with error in API/CLI
hammer host update --name='host.testdomain' --new-name hosta

in UI it not even throws an error, user is just unable to confirm the change

Ends up with error.
Could not update the host:
Puppetclasses generic_1 does not belong to the env_1 environment

Actual results:
problem 1. puppet classes are not shown in UI, in create or edit host page
problem 2.
Could not update the host:
Puppetclasses generic_1 does not belong to the env_1 environment
but generic_1 is not connected to env_1 only env_2

Expected results:
problem 1. puppet classes are shown in create/edit host page
problem 2. it would be possible to update the host

Additional info:
this doesn't happen on sat 6.9, it was introduced with 6.10, as there is plenty of changes with puppet modules removal, and puppet content publishing
There was a discussion with ewoud about this. Let me know I will be happy to forward it to you.

The difference between sat 6.9 and 6.10. where Host YAML output is shown.
The same steps as described above were done, only difference here it was done with our automation, so names are randomly generated.

6.9 host YAML ommitted to name, environment and classes
name: jftoackdlt.vyey6mcxae
classes:
api_test_classparameters:
environment: qhvalEDtvj

6.10 host YAML ommitted to name, environment and classes

name: elpsjvvesk.fvfhnxnacg
classes:
access_insights_client:
access_insights_client::current:
access_insights_client::old:
api_test_classparameters:
api_test_classparameters::subclass_1:
api_test_classparameters::subclass_2:
api_test_classparameters::subclass_3:
api_test_classparameters::subclass_4:
api_test_classparameters::subclass_5:
api_test_classparameters::subclass_6:
api_test_classparameters::subclass_7:
api_test_classparameters::subclass_8:
foreman_scap_client:
foreman_scap_client::params:
stdlib:
stdlib::stages:
environment: TqMGWhABjf

As can be seen the 6.10 has all the classes assigned, where in 6.9 there is only chosen class (api_test_classparameters) assigned.
Above results can be qualified as problem 3. And expected result shows only correct environment as shown in sat 6.9 above.
This of course do not explain error puppet class generic_1 does not belong to environment env_1 or in this example, to TqMGWhABjf.

We would like to get this resolved for QE automation purpose.
I can provide the machine with required setup to developer.

Actions #1

Updated by The Foreman Bot over 2 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/815 added
Actions #2

Updated by Chris Roberts over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #3

Updated by Justin Sherrill over 2 years ago

  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF