Project

General

Profile

Bug #8642

Host to Puppet class association throws: unknown attribute: puppet_class_ids

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

Status:
Closed
Priority:
High
Assignee:
-
Category:
Foreman commands (obsolete)
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

When using the new --puppet-class-ids argument to update a host, it throws an error about the attribute being unknown. Seems it needs to remove the underscore from the attribute name.

$ hammer -d host update --puppet-class-ids 1 --id 1
[ INFO 2014-12-10 11:50:37 Init] Initialization of Hammer CLI (0.1.3) has started...
[DEBUG 2014-12-10 11:50:37 Init] Running at ruby 1.8.7-p352
[ INFO 2014-12-10 11:50:37 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2014-12-10 11:50:37 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-12-10 11:50:37 Init] Configuration from the file /root/.hammer/cli.modules.d/foreman.yml has been loaded
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:68: warning: already initialized constant DEFAULT_LABEL_INDENT
[DEBUG 2014-12-10 11:50:37 Connection] Registered: foreman
[DEBUG 2014-12-10 11:50:37 API] Global headers: {
    "Accept-Language" => "en_GB",
              :accept => "application/json;version=2",
        :content_type => "application/json" 
}
[ INFO 2014-12-10 11:50:38 Modules] Extension module hammer_cli_foreman (0.1.3) loaded
[DEBUG 2014-12-10 11:50:38 Init] Using locale 'en_GB'
[DEBUG 2014-12-10 11:50:38 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/locale'
[DEBUG 2014-12-10 11:50:38 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2014-12-10 11:50:38 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/locale'
[DEBUG 2014-12-10 11:50:38 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[ INFO 2014-12-10 11:50:38 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2014-12-10 11:50:38 HammerCLIForeman::Host] Called with options: {}
[ INFO 2014-12-10 11:50:38 HammerCLIForeman::Host::UpdateCommand] Called with options: {"option_interface_list"=>[], "option_puppet_class_ids"=>["1"], "option_volume_list"=>[], "option_id"=>"1"}
[ INFO 2014-12-10 11:50:38 API] PUT /api/hosts/1
[DEBUG 2014-12-10 11:50:38 API] Params: {
    "host" => {
                          "owner_id" => nil,
                "compute_attributes" => {
            "volumes_attributes" => {}
        },
        "host_parameters_attributes" => {},
                  "puppet_class_ids" => [
            [0] "1" 
        ],
                   "puppet_proxy_id" => nil,
                "puppet_ca_proxy_id" => nil,
             "interfaces_attributes" => {}
    }
}
[DEBUG 2014-12-10 11:50:38 API] Headers: {}
[DEBUG 2014-12-10 11:50:38 API] 500 Internal Server Error
{
    "error" => {
        "message" => "unknown attribute: puppet_class_ids" 
    }
}
[ERROR 2014-12-10 11:50:38 Exception] unknown attribute: puppet_class_ids
Could not update the host:
  unknown attribute: puppet_class_ids
[ERROR 2014-12-10 11:50:38 Exception] 

RestClient::InternalServerError (500 Internal Server Error):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:80:in `put'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `send'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:279:in `call_client'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:210:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/api.rb:161:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.11/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:43:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:179:in `send_request'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:34:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:23:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/bin/hammer:108
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Our nightly tests rely on this association, so it's currently failing there.


Related issues

Related to Hammer CLI - Feature #8246: Allow name resolution for arraysClosed2014-11-03
Related to Hammer CLI - Bug #8651: Host to Puppet class association isn't actually sending puppetclass_idsClosed2014-12-10

Associated revisions

Revision 48aed497
Added by mbacovsky over 7 years ago

Merge pull request #161 from tstrachota/puppet_class_ids

Fixes #8642 - setting --puppet-class-ids on host create/update throws

Revision 2de1340b (diff)
Added by Tomas Strachota over 7 years ago

Fixes #8642 - setting --puppet-class-ids on host create/update throws
api exception

History

#1 Updated by Dominic Cleal over 7 years ago

  • Related to Feature #8246: Allow name resolution for arrays added

#2 Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/161 added
  • Pull request deleted ()

#3 Updated by Anonymous over 7 years ago

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

#4 Updated by Dominic Cleal over 7 years ago

  • Related to Bug #8651: Host to Puppet class association isn't actually sending puppetclass_ids added

Also available in: Atom PDF