Bug 1519779
| Summary: | puppet classes info doesn't consider puppet environments parameter | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Sanket Jagtap <sjagtap> | ||||||
| Component: | Puppet | Assignee: | Ondřej Pražák <oprazak> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Sanket Jagtap <sjagtap> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 6.2.13 | CC: | akarsale, dhlavacd, egolov, kgaikwad, mhulan, oprazak, rabajaj, sghai, sjagtap | ||||||
| Target Milestone: | 6.5.0 | Keywords: | Triaged | ||||||
| Target Release: | Unused | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | foreman-1.20.0-0, rubygem-foreman_maintain-0.3.0 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2019-05-14 12:36:46 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: | |||||||||
| Attachments: |
|
||||||||
Sanket, could you please check whether you can achieve it through API? That will help us to find out, where is the issue. Thanks for hammer -d output, that helps too. Marek , will update you on this, as soon as I could get hold on upgrade RHEL7 box.
This only happens on the Upgrade RHEL7 box, and I was unable to reproduce the same with upgrade RHEL6 box.
On RHEL6 , even though the puppet class shared Environments I was able to list them successfully
hammer> puppet-class list --environment="KT_NPS3rZ_Library_aqaWndLuUR_197"
----|----------------------------
ID | NAME
----|----------------------------
1 | access_insights_client
2 | foreman_scap_client
3 | foreman_scap_client::params
123 | generic_1
4 | stdlib
5 | stdlib::stages
----|----------------------------
hammer> puppet-class info --environment="KT_NPS3rZ_Library_aqaWndLuUR_197" --name generic_1
Id: 123
Name: generic_1
Smart variables:
1) Parameter:
Default value:
Smart class parameters:
generic_1_scp_001
<truncated>
Hostgroups:
Environments:
KT_NPS3rZ_Library_aqaWndLuUR_197
KT_rQjElY_Library_dAXSrxvSDD_213
KT_SjMpUy_Library_eijWCyKjfe_278
Parameters:
Created attachment 1367326 [details]
6.2.13 puppet-class info
I fail to reproduce on newly installed 6.2.13
Build: Satellite 6.3.0 snap 30 This also started to appear with snap 30 PFA CLI hammer -d output and via API call Build: Satellite 6.4 snap 11
We are hitting this again on an upgraded box, which was upgraded from 6.3.z to 6.4. snap 11.
We just have one puppet-class named "generic_1" in that env. puppet class info, has a parameter to search in environment but it doesn't do that.
hammer -v -u admin -p changeme puppet-class info --name="generic_1" --environment="KT_d9pR4I_Library_PtGKAORQmb_198"
[ERROR 2018-07-09T07:36:58 Exception] Error: Found more than one puppetclass.
Error: Found more than one puppetclass.
[ERROR 2018-07-09T07:36:58 Exception]
HammerCLIForeman::ResolverError (Found more than one puppetclass.):
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/id_resolver.rb:242:in `pick_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/id_resolver.rb:292:in `puppetclass_id'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/commands.rb:131:in `get_resource_id'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/commands.rb:119:in `get_identifier'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.0/lib/hammer_cli_foreman/option_sources/self_param.rb:11:in `get_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:13:in `block in all_options_raw'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:12:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:12:in `inject'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:12:in `all_options_raw'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:18:in `all_options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/options/option_collector.rb:22:in `options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:239:in `options'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:42:in `parse'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:62:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/lib/hammer_cli/abstract.rb:29:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.0/bin/hammer:143:in `<top (required)>'
/usr/bin/hammer:23:in `load'
/usr/bin/hammer:23:in `<main>'
[root@qe-sat6-upgrade-rhel7 ~]# hammer -v -u admin -p changeme puppet-class list --environment="KT_d9pR4I_Library_PtGKAORQmb_198"
---|----------------------------
ID | NAME
---|----------------------------
1 | access_insights_client
4 | foreman_scap_client
5 | foreman_scap_client::params
97 | generic_1
2 | stdlib
3 | stdlib::stages
---|----------------------------
[root@qe-sat6-upgrade-rhel7 ~]# hammer -v -u admin -p changeme puppet-class info --help
Usage:
hammer puppet-class info [OPTIONS]
Options:
--environment ENVIRONMENT_NAME Environment name
--environment-id ENVIRONMENT_ID
--host HOST_NAME Host name
--host-id HOST_ID
--hostgroup HOSTGROUP_NAME Hostgroup name
--hostgroup-id HOSTGROUP_ID
--hostgroup-title HOSTGROUP_TITLE Hostgroup title
--id ID ID of Puppet class
--location LOCATION_NAME Location name
--location-id LOCATION_ID
--location-title LOCATION_TITLE Location title
--name NAME Puppet class name
--organization ORGANIZATION_NAME Organization name
--organization-id ORGANIZATION_ID Organization ID
--organization-title ORGANIZATION_TITLE Organization title
-h, --help Print help
Created redmine issue http://projects.theforeman.org/issues/24633 from this bug Upstream bug assigned to oprazak Upstream bug assigned to oprazak Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24633 has been resolved. 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/RHSA-2019:1222 |
Created attachment 1361573 [details] hammer output with debug Description of problem: Version-Release number of selected component (if applicable): 6.2.13 snap1 How reproducible: Always Steps to Reproduce: 1. Have two puppet classes with same name in different environment -bash-4.2# hammer -u admin -p changeme puppet-class list --environment="KT_9UEYTp_Library_wrzITAjOEQ_199" ----|---------------------------- ID | NAME ----|---------------------------- 1 | access_insights_client 4 | foreman_scap_client 5 | foreman_scap_client::params 122 | generic_1 2 | stdlib 3 | stdlib::stages ----|---------------------------- -bash-4.2# hammer -u admin -p changeme puppet-class info --environment="KT_9UEYTp_Library_wrzITAjOEQ_199" --name="generic_1" Error: found more than one puppetclass The environment and environment-id parameter is not consider while looking for the class Actual results: Error: found more than one puppetclass Expected results: puppet class should be listed Additional info: Not a regression