Project

General

Profile

Actions

Bug #12090

closed

foreman-cli 0.4 does not work with foreman 1.10-dev

Added by Daniel Gagnon over 8 years ago. Updated over 8 years ago.

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

Description

creating a host with parameters gives the following error:

[DEBUG 2015-10-07 17:27:01 API] Headers: {}
[DEBUG 2015-10-07 17:27:01 API] 500 Internal Server Error
{
    "error" => {
        "message" => "unknown attribute: nested" 
    }
}
[ERROR 2015-10-07 17:27:01 Exception] unknown attribute: nested
Could not create the host:
  unknown attribute: nested
[ERROR 2015-10-07 17:27:01 Exception]

RestClient::InternalServerError (500 Internal Server Error):
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/abstract_response.rb:48:in `return!'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:269:in `process_result'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:212:in `block in transmit'
    /usr/lib/ruby/1.9.1/net/http.rb:745:in `start'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:206:in `transmit'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:68:in `execute'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/request.rb:35:in `execute'
    /var/lib/gems/1.9.1/gems/rest-client-1.6.8/lib/restclient/resource.rb:67:in `post'
    /var/lib/gems/1.9.1/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:285:in `call_client'
    /var/lib/gems/1.9.1/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:216:in `http_call'
    /var/lib/gems/1.9.1/gems/apipie-bindings-0.0.15/lib/apipie_bindings/api.rb:162:in `call'
    /var/lib/gems/1.9.1/gems/apipie-bindings-0.0.15/lib/apipie_bindings/resource.rb:14:in `call'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /usr/lib/ruby/vendor_ruby/hammer_cli_foreman/commands.rb:185:in `send_request'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/lib/ruby/vendor_ruby/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/vendor_ruby/clamp/command.rb:68:in `run'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/lib/hammer_cli/abstract.rb:23:in `run'
    /usr/lib/ruby/vendor_ruby/clamp/command.rb:133:in `run'
    /var/lib/gems/1.9.1/gems/hammer_cli-0.4.0/bin/hammer:125:in `<top (required)>'
    /usr/local/bin/hammer:23:in `load'
    /usr/local/bin/hammer:23:in `<main>'

I believe the issue is with the added field in the json query called nested:

        "host_parameters_attributes" => [
            [ 0] {
                  "name" => "raidstyle",
                 "value" => "\"none\"",
                "nested" => "" 
            },

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #12566: New Host API changed host_parameters_attributes behaviorClosedLukas Zapletal11/23/2015Actions
Actions #1

Updated by Daniel Gagnon over 8 years ago

in host.rb, replacing line 115:

{"name"=>key, "value"=>value.inspect, "nested"=>""}

by

{"name"=>key, "value"=>value.inspect}

solves the issue.

Actions #2

Updated by Daniel Gagnon over 8 years ago

submitted PR #198

Actions #3

Updated by Dominic Cleal over 8 years ago

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

Updated by Anonymous over 8 years ago

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

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #12566: New Host API changed host_parameters_attributes behavior added
Actions

Also available in: Atom PDF