Project

General

Profile

Actions

Bug #8642

closed

Host to Puppet class association throws: unknown attribute: puppet_class_ids

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

Status:
Closed
Priority:
High
Assignee:
-
Category:
Foreman commands (obsolete)
Target version:
-
Difficulty:
Triaged:
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
[[32m INFO[0m [34m2014-12-10 11:50:37[0m [36mInit[0m] Initialization of Hammer CLI (0.1.3) has started...
[DEBUG [34m2014-12-10 11:50:37[0m [36mInit[0m] Running at ruby 1.8.7-p352
[[32m INFO[0m [34m2014-12-10 11:50:37[0m [36mInit[0m] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[[32m INFO[0m [34m2014-12-10 11:50:37[0m [36mInit[0m] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[[32m INFO[0m [34m2014-12-10 11:50:37[0m [36mInit[0m] 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 [34m2014-12-10 11:50:37[0m [36mConnection[0m] Registered: foreman
[DEBUG [34m2014-12-10 11:50:37[0m [36mAPI[0m] Global headers: {
    "Accept-Language" => "en_GB",
              :accept => "application/json;version=2",
        :content_type => "application/json" 
}
[[32m INFO[0m [34m2014-12-10 11:50:38[0m [36mModules[0m] Extension module hammer_cli_foreman (0.1.3) loaded
[DEBUG [34m2014-12-10 11:50:38[0m [36mInit[0m] Using locale 'en_GB'
[DEBUG [34m2014-12-10 11:50:38[0m [36mInit[0m] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/locale'
[DEBUG [34m2014-12-10 11:50:38[0m [36mInit[0m] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG [34m2014-12-10 11:50:38[0m [36mInit[0m] '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 [34m2014-12-10 11:50:38[0m [36mInit[0m] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[[32m INFO[0m [34m2014-12-10 11:50:38[0m [36mHammerCLI::MainCommand[0m] Called with options: {"option_debug"=>true}
[[32m INFO[0m [34m2014-12-10 11:50:38[0m [36mHammerCLIForeman::Host[0m] Called with options: {}
[[32m INFO[0m [34m2014-12-10 11:50:38[0m [36mHammerCLIForeman::Host::UpdateCommand[0m] Called with options: {"option_interface_list"=>[], "option_puppet_class_ids"=>["1"], "option_volume_list"=>[], "option_id"=>"1"}
[[32m INFO[0m [34m2014-12-10 11:50:38[0m [36mAPI[0m] PUT /api/hosts/1
[DEBUG [34m2014-12-10 11:50:38[0m [36mAPI[0m] 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 [34m2014-12-10 11:50:38[0m [36mAPI[0m] Headers: {}
[DEBUG [34m2014-12-10 11:50:38[0m [36mAPI[0m] 500 Internal Server Error
{
    "error" => {
        "message" => "unknown attribute: puppet_class_ids" 
    }
}
[[31mERROR[0m [34m2014-12-10 11:50:38[0m [36mException[0m] unknown attribute: puppet_class_ids
Could not update the host:
  unknown attribute: puppet_class_ids
[[31mERROR[0m [34m2014-12-10 11:50:38[0m [36mException[0m] 

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 2 (0 open2 closed)

Related to Hammer CLI - Feature #8246: Allow name resolution for arraysClosedTomáš Strachota11/03/2014Actions
Related to Hammer CLI - Bug #8651: Host to Puppet class association isn't actually sending puppetclass_idsClosed12/10/2014Actions
Actions

Also available in: Atom PDF