Bug #4130

Puppet class import command fails silently

Added by Dominic Cleal over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Stephan Dollberg
Category:Foreman commands
Target version:Foreman - Sprint 21
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-

Description

Description of problem:
Hammer cli command to import classes fails

Version-Release number of selected component (if applicable):
  1. rpm -qa | grep foreman
    rubygem-hammer_cli_foreman-0.0.15-1.el6.noarch
    foreman-compute-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    foreman-installer-1.4.0-0.develop.201312272053gitbc2acd9.el6.noarch
    foreman-release-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    foreman-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    foreman-ovirt-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    foreman-proxy-1.4.0-0.develop.201312091021git42bab91.el6.noarch
    foreman-postgresql-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    rubygem-foreman_api-0.1.9-1.el6.noarch
    foreman-libvirt-1.4.0-0.develop.201401011454git1245d23.el6.noarch
    foreman-selinux-1.4.0-0.develop.201311220906gite342a0b.el6.noarch

How reproducible:
everytime

Steps to Reproduce:
1.# hammer proxy import_classes --id 1
Puppet classes were imported

2.# hammer -v sc_param list
[ INFO 2014-01-03 07:57:09 Init] Initialization of Hammer CLI (0.0.14) has started...
[ INFO 2014-01-03 07:57:09 Init] Configuration from the file /etc/foreman/cli_config.yml has been loaded
[ INFO 2014-01-03 07:57:09 Modules] Extension module hammer_cli_foreman (0.0.15) loaded
[ INFO 2014-01-03 07:57:09 HammerCLI::MainCommand] Called with options: {"verbose"=>true}
[ INFO 2014-01-03 07:57:09 HammerCLIForeman::SmartClassParameter] Called with options: {}
[ INFO 2014-01-03 07:57:09 HammerCLIForeman::SmartClassParameter::ListCommand] Called with options: {}
[DEBUG 2014-01-03 07:57:09 HammerCLIForeman::SmartClassParameter::ListCommand] Retrieved data:
[]
No data.

3.# hammer environment sc_params --id 1
No data.

Actual results:
Unable to view the list

Expected results:
List displayed

(https://bugzilla.redhat.com/show_bug.cgi?id=1048232)


Related issues

Related to Hammer CLI - Bug #4609: Better message when importing classes doesn't find any ne... New 03/10/2014

Associated revisions

Revision 5f7746a1
Added by Stephan Dollberg over 3 years ago

Fixes #4130 - default value for proxy import_puppetclasses --dryrun

dryrun option needs to be false and not nil

History

#1 Updated by Dominic Cleal over 3 years ago

Started POST "/api/smart_proxies/1/import_puppetclasses" for ::1 at 2014-01-20 13:41:54 +0000
Processing by Api::V2::SmartProxiesController#import_puppetclasses as JSON
  Parameters: {"dryrun"=>nil, "apiv"=>"v2", "id"=>"1", "smart_proxy"=>{}}
Authorized user admin(Admin User)
  Rendered api/v1/import_puppetclasses/index.json.rabl within api/layouts/import_puppetclasses_layout (1.7ms)
Completed 200 OK in 300ms (Views: 3.9ms | ActiveRecord: 12.6ms)

I think the dryrun parameter needs explicitly setting to false (boolean) or "false" (string), else the API controller assumes it's true.

#3 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Stephan Dollberg
  • Target version set to Sprint 21

#4 Updated by Stephan Dollberg over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Applied in changeset foreman:hammer-cli-foreman|commit:5f7746a12dc4f8fb3a8c10159109e4bf52ec7192.

#5 Updated by Tomáš Strachota over 3 years ago

  • Related to Bug #4609: Better message when importing classes doesn't find any new ones added

#6 Updated by Tomáš Strachota over 3 years ago

  • Status changed from Closed to Ready For Testing

This fix covers the problem only partially. I created a new issue for the second part:
http://projects.theforeman.org/issues/4609

#7 Updated by Tomáš Strachota over 3 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF