Hammer CLI template creation

Hello, i'm trying to script my foreman install with REST Api and Hammer
CLI, but i run into a problem with template creation.

hammer -u admin -p changeme template create --name "test" --type "finish"
–file ./test
Could not create the config template:
Error: Received data of unknown format

Hammer log output :

[ERROR 2014-05-27 06:46:26 Exception] Error: Received data of unknown format
[ERROR 2014-05-27 06:46:26 Exception]

RuntimeError (Received data of unknown format):

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in
`collection_to_common_format'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in
`option_template_kind_id'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in
`send'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in
`get_option_value'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`each'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`each'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in
`method_options'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in
`request_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in
`request_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in
`send_request'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in
`send_request'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in
execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22: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:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22: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:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22:in
run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19

using versions :

rpm -qa | grep foreman
foreman-vmware-1.5.0-1.el6.noarch
rubygem-foreman_api-0.1.11-1.el6.noarch
foreman-installer-1.5.0-1.el6.noarch
foreman-1.5.0-1.el6.noarch
foreman-compute-1.5.0-1.el6.noarch
ruby193-rubygem-foreman_bootdisk-2.0.7-1.el6.noarch
ruby193-rubygem-foreman_setup-2.0.3-1.el6.noarch
foreman-postgresql-1.5.0-1.el6.noarch
foreman-selinux-1.5.0-1.el6.noarch
rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch
foreman-proxy-1.5.0-1.el6.noarch

rpm -qa | grep hammer
rubygem-hammer_cli-0.1.1-1.201405271206git41f59a5.el6.noarch
rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch

Using REST Api i can create a template, but as far as i know there's no way
to give a file as template input.

Hello.

The command you mentioned is working fine for me.

Can you please run it with "hammer --debug …" please?

Thank you

PetrR

··· On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth wrote: > > Hello, i'm trying to script my foreman install with REST Api and Hammer > CLI, but i run into a problem with template creation. > > hammer -u admin -p changeme template create --name "test" --type "finish" > --file ./test > Could not create the config template: > Error: Received data of unknown format > > Hammer log output : > > [ERROR 2014-05-27 06:46:26 Exception] Error: Received data of unknown > format > [ERROR 2014-05-27 06:46:26 Exception] > > RuntimeError (Received data of unknown format): > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > `collection_to_common_format' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > `option_template_kind_id' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `send' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `get_option_value' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > `method_options' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > `execute' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > `run' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > `run' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > > using versions : > > rpm -qa | grep foreman > foreman-vmware-1.5.0-1.el6.noarch > rubygem-foreman_api-0.1.11-1.el6.noarch > foreman-installer-1.5.0-1.el6.noarch > foreman-1.5.0-1.el6.noarch > foreman-compute-1.5.0-1.el6.noarch > ruby193-rubygem-foreman_bootdisk-2.0.7-1.el6.noarch > ruby193-rubygem-foreman_setup-2.0.3-1.el6.noarch > foreman-postgresql-1.5.0-1.el6.noarch > foreman-selinux-1.5.0-1.el6.noarch > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > foreman-proxy-1.5.0-1.el6.noarch > > rpm -qa | grep hammer > rubygem-hammer_cli-0.1.1-1.201405271206git41f59a5.el6.noarch > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > > Using REST Api i can create a template, but as far as i know there's no > way to give a file as template input. >

Here is the ouptut in debug mode :

hammer --debug -u admin -p changeme template create --name "test" --type
"finish" --file ./test
[ INFO 2014-05-27 09:44:27 Init] Initialization of Hammer CLI (0.1.1) has
started…
[DEBUG 2014-05-27 09:44:27 Init] Running at ruby 1.8.7-p352
[ INFO 2014-05-27 09:44:27 Init] Configuration from the file
/etc/hammer/cli_config.yml has been loaded
[ INFO 2014-05-27 09:44:27 Init] Configuration from the file
/etc/hammer/cli.modules.d/foreman.yml has been loaded
[DEBUG 2014-05-27 09:44:28 Connection] Registered: foreman
[DEBUG 2014-05-27 09:44:28 API] Global headers: {
:content_type => "application/json",
"Accept-Language" => "en",
:accept => "application/json;version=2"
}
[ INFO 2014-05-27 09:44:28 API] GET /apidoc/apipie_checksum
[DEBUG 2014-05-27 09:44:28 API] Params: {}
[DEBUG 2014-05-27 09:44:28 API] Headers: {
:accept => "application/json",
:params => {}
}
[DEBUG 2014-05-27 09:44:28 API] Response {
"checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0"
}
[ INFO 2014-05-27 09:44:29 Modules] Extension module hammer_cli_foreman
(0.1.1) loaded
[DEBUG 2014-05-27 09:44:29 Init] Using locale 'en'
[DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain 'hammer-cli'
loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale'
[DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain
'hammer-cli-foreman' loaded from
'/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale'
[ INFO 2014-05-27 09:44:29 HammerCLI::MainCommand] Called with options:
{"option_debug"=>true, "option_username"=>"admin", "option_password"=>""}
[ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template] Called with options:
{}
[ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template::CreateCommand]
Called with options: {"option_type"=>"finish", "option_name"=>"test",
"option_template"=>"#End of Build\r\n<%- if @host.shortname.include?
&quot;log&quot; %>\r\necho &quot;fs.file-max = 65535&quot; >> /etc/sysctl.conf\r\necho &quot;

soft nofile 65535&quot; >> /etc/security/limits.conf\r\necho &quot;
hard nofile
65535&quot; >> /etc/security/limits.conf\r\necho &quot;
soft memlock unlimited&quot;
>> /etc/security/limits.conf\r\necho &quot;* hard memlock unlimited&quot; >>
/etc/security/limits.conf\r\n<%- end %>\r\nwget --quiet
–output-document=/dev/null --no-check-certificate <%= foreman_url
%>\r\n\r\n"}
[ INFO 2014-05-27 09:44:29 API] GET /apidoc/apipie_checksum
[DEBUG 2014-05-27 09:44:29 API] Params: {}
[DEBUG 2014-05-27 09:44:29 API] Headers: {
:accept => "application/json",
:params => {}
}
[DEBUG 2014-05-27 09:44:29 API] Response {
"checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0"
}
[ INFO 2014-05-27 09:44:29 API] GET /api/template_kinds
[DEBUG 2014-05-27 09:44:29 API] Params: {}
[DEBUG 2014-05-27 09:44:29 API] Headers: {
:params => {}
}
[DEBUG 2014-05-27 09:44:29 API] Response #<String:0x7f9c297551f8
attr_accessor :args = {
:method => :get,
:headers => {
:content_type => "application/json",
"Accept-Language" => "en",
:accept => "application/json;version=2"
},
:timeout => nil,
:oauth => nil,
:url => "https://localhost//api/template_kinds",
:user => "admin",
:password => "changeme"
},
attr_accessor :net_http_res = #<Net::HTTPOK:0x7f9c29758510
@body_exist = true,
@read = true,
@socket = nil,
attr_reader :body = …String…,
attr_reader :code = "200",
attr_reader :header = {
"x-rack-cache" => [
[0] "miss"
],
"x-runtime" => [
[0] "0.033649"
],
"status" => [
[0] "200 OK"
],
"foreman_api_version" => [
[0] "2"
],
"server" => [
[0] "Apache/2.2.15 (CentOS)"
],
"transfer-encoding" => [
[0] "chunked"
],
"x-ua-compatible" => [
[0] "IE=Edge,chrome=1"
],
"content-type" => [
[0] "application/json; charset=utf-8"
],
"etag" => [
[0] "&quot;6371033602a4b5f28eaf25f665395a20&quot;"
],
"apipie-checksum" => [
[0] "fcdc22ab0a28f9d67de798fc2a8aa6e0"
],
"x-request-id" => [
[0] "fbadc9821ef7d9bce418131992f7d3cc"
],
"date" => [
[0] "Tue, 27 May 2014 07:44:29 GMT"
],
"connection" => [
[0] "close"
],
"x-powered-by" => [
[0] "Phusion Passenger 4.0.18"
],
"set-cookie" => [
[0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; path=/;
HttpOnly"
],
"cache-control" => [
[0] "must-revalidate, private, max-age=0"
],
"foreman_version" => [
[0] "1.5.0"
]
},
attr_reader :http_version = "1.1",
attr_reader :message = "OK"
>,
attr_reader :code = 200,
attr_reader :headers = {
:status => "200 OK",
:x_runtime => "0.033649",
:x_powered_by => "Phusion Passenger 4.0.18",
:content_type => "application/json; charset=utf-8",
:set_cookie => [
[0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; path=/;
HttpOnly"
],
:server => "Apache/2.2.15 (CentOS)",
:x_rack_cache => "miss",
:connection => "close",
:cache_control => "must-revalidate, private, max-age=0",
:x_ua_compatible => "IE=Edge,chrome=1",
:date => "Tue, 27 May 2014 07:44:29 GMT",
:transfer_encoding => "chunked",
:foreman_api_version => "2",
:foreman_version => "1.5.0",
:etag => "&quot;6371033602a4b5f28eaf25f665395a20&quot;",
:apipie_checksum => "fcdc22ab0a28f9d67de798fc2a8aa6e0",
:x_request_id => "fbadc9821ef7d9bce418131992f7d3cc"
}
>
[ERROR 2014-05-27 09:44:29 Exception] Error: Received data of unknown format
Could not create the config template:
Error: Received data of unknown format
[ERROR 2014-05-27 09:44:29 Exception]

RuntimeError (Received data of unknown format):

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in
`collection_to_common_format'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in
`option_template_kind_id'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in
`send'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in
`get_option_value'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`each'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`each'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in
`method_options_for_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in
`method_options'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in
`request_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in
`request_params'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in
`send_request'

/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in
`send_request'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in
execute&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22:in
`run'

/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in
execute&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22:in
`run'

/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in
execute&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:inrun'

/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22:in
run&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19

··· Le mercredi 28 mai 2014 14:17:25 UTC+2, Petr Ruzicka a écrit : > > Hello. > > The command you mentioned is working fine for me. > > Can you please run it with "hammer --debug ..." please? > > Thank you > > PetrR > > > > On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth wrote: >> >> Hello, i'm trying to script my foreman install with REST Api and Hammer >> CLI, but i run into a problem with template creation. >> >> hammer -u admin -p changeme template create --name "test" --type "finish" >> --file ./test >> Could not create the config template: >> Error: Received data of unknown format >> >> Hammer log output : >> >> [ERROR 2014-05-27 06:46:26 Exception] Error: Received data of unknown >> format >> [ERROR 2014-05-27 06:46:26 Exception] >> >> RuntimeError (Received data of unknown format): >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in >> `collection_to_common_format' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in >> `option_template_kind_id' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in >> `send' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in >> `get_option_value' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in >> `method_options_for_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in >> `each' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in >> `method_options_for_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in >> `method_options_for_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in >> `each' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in >> `method_options_for_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in >> `method_options' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in >> `request_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in >> `request_params' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in >> `send_request' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in >> `send_request' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in >> `execute' >> /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in >> `run' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in >> `run' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in >> `run' >> >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in >> `run' >> /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in >> `run' >> /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 >> /usr/bin/hammer:19:in `load' >> /usr/bin/hammer:19 >> >> using versions : >> >> rpm -qa | grep foreman >> foreman-vmware-1.5.0-1.el6.noarch >> rubygem-foreman_api-0.1.11-1.el6.noarch >> foreman-installer-1.5.0-1.el6.noarch >> foreman-1.5.0-1.el6.noarch >> foreman-compute-1.5.0-1.el6.noarch >> ruby193-rubygem-foreman_bootdisk-2.0.7-1.el6.noarch >> ruby193-rubygem-foreman_setup-2.0.3-1.el6.noarch >> foreman-postgresql-1.5.0-1.el6.noarch >> foreman-selinux-1.5.0-1.el6.noarch >> rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch >> foreman-proxy-1.5.0-1.el6.noarch >> >> rpm -qa | grep hammer >> rubygem-hammer_cli-0.1.1-1.201405271206git41f59a5.el6.noarch >> rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch >> >> Using REST Api i can create a template, but as far as i know there's no >> way to give a file as template input. >> >

Hello,
unfortunately I wasn't able to reproduce the error either. What version
is the server you run the commands against, please?

Regards
Tomas

··· On 05/28/2014 02:50 PM, Alexandre Barth wrote: > Here is the ouptut in debug mode : > > hammer --debug -u admin -p changeme template create --name "test" --type > "finish" --file ./test > [ INFO 2014-05-27 09:44:27 Init] Initialization of Hammer CLI (0.1.1) > has started... > [DEBUG 2014-05-27 09:44:27 Init] Running at ruby 1.8.7-p352 > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > /etc/hammer/cli_config.yml has been loaded > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > /etc/hammer/cli.modules.d/foreman.yml has been loaded > [DEBUG 2014-05-27 09:44:28 Connection] Registered: foreman > [DEBUG 2014-05-27 09:44:28 API] Global headers: { > :content_type => "application/json", > "Accept-Language" => "en", > :accept => "application/json;version=2" > } > [ INFO 2014-05-27 09:44:28 API] GET /apidoc/apipie_checksum > [DEBUG 2014-05-27 09:44:28 API] Params: {} > [DEBUG 2014-05-27 09:44:28 API] Headers: { > :accept => "application/json", > :params => {} > } > [DEBUG 2014-05-27 09:44:28 API] Response { > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > } > [ INFO 2014-05-27 09:44:29 Modules] Extension module hammer_cli_foreman > (0.1.1) loaded > [DEBUG 2014-05-27 09:44:29 Init] Using locale 'en' > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > 'hammer-cli' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > 'hammer-cli-foreman' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' > [ INFO 2014-05-27 09:44:29 HammerCLI::MainCommand] Called with options: > {"option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"} > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template] Called with > options: {} > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template::CreateCommand] > Called with options: {"option_type"=>"finish", "option_name"=>"test", > "option_template"=>"#End of Build\r\n<%- if @host.shortname.include? > \"log\" %>\r\necho \"fs.file-max = 65535\" >> /etc/sysctl.conf\r\necho > \"* soft nofile 65535\" >> /etc/security/limits.conf\r\necho \"* hard > nofile 65535\" >> /etc/security/limits.conf\r\necho \"* soft memlock > unlimited\" >> /etc/security/limits.conf\r\necho \"* hard memlock > unlimited\" >> /etc/security/limits.conf\r\n<%- end %>\r\nwget --quiet > --output-document=/dev/null --no-check-certificate <%= foreman_url > %>\r\n\r\n"} > [ INFO 2014-05-27 09:44:29 API] GET /apidoc/apipie_checksum > [DEBUG 2014-05-27 09:44:29 API] Params: {} > [DEBUG 2014-05-27 09:44:29 API] Headers: { > :accept => "application/json", > :params => {} > } > [DEBUG 2014-05-27 09:44:29 API] Response { > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > } > [ INFO 2014-05-27 09:44:29 API] GET /api/template_kinds > [DEBUG 2014-05-27 09:44:29 API] Params: {} > [DEBUG 2014-05-27 09:44:29 API] Headers: { > :params => {} > } > [DEBUG 2014-05-27 09:44:29 API] Response # attr_accessor :args = { > :method => :get, > :headers => { > :content_type => "application/json", > "Accept-Language" => "en", > :accept => "application/json;version=2" > }, > :timeout => nil, > :oauth => nil, > :url => "https://localhost//api/template_kinds", > :user => "admin", > :password => "changeme" > }, > attr_accessor :net_http_res = # @body_exist = true, > @read = true, > @socket = nil, > attr_reader :body = ...String..., > attr_reader :code = "200", > attr_reader :header = { > "x-rack-cache" => [ > [0] "miss" > ], > "x-runtime" => [ > [0] "0.033649" > ], > "status" => [ > [0] "200 OK" > ], > "foreman_api_version" => [ > [0] "2" > ], > "server" => [ > [0] "Apache/2.2.15 (CentOS)" > ], > "transfer-encoding" => [ > [0] "chunked" > ], > "x-ua-compatible" => [ > [0] "IE=Edge,chrome=1" > ], > "content-type" => [ > [0] "application/json; charset=utf-8" > ], > "etag" => [ > [0] "\"6371033602a4b5f28eaf25f665395a20\"" > ], > "apipie-checksum" => [ > [0] "fcdc22ab0a28f9d67de798fc2a8aa6e0" > ], > "x-request-id" => [ > [0] "fbadc9821ef7d9bce418131992f7d3cc" > ], > "date" => [ > [0] "Tue, 27 May 2014 07:44:29 GMT" > ], > "connection" => [ > [0] "close" > ], > "x-powered-by" => [ > [0] "Phusion Passenger 4.0.18" > ], > "set-cookie" => [ > [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; > path=/; HttpOnly" > ], > "cache-control" => [ > [0] "must-revalidate, private, max-age=0" > ], > "foreman_version" => [ > [0] "1.5.0" > ] > }, > attr_reader :http_version = "1.1", > attr_reader :message = "OK" > >, > attr_reader :code = 200, > attr_reader :headers = { > :status => "200 OK", > :x_runtime => "0.033649", > :x_powered_by => "Phusion Passenger 4.0.18", > :content_type => "application/json; charset=utf-8", > :set_cookie => [ > [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; path=/; > HttpOnly" > ], > :server => "Apache/2.2.15 (CentOS)", > :x_rack_cache => "miss", > :connection => "close", > :cache_control => "must-revalidate, private, max-age=0", > :x_ua_compatible => "IE=Edge,chrome=1", > :date => "Tue, 27 May 2014 07:44:29 GMT", > :transfer_encoding => "chunked", > :foreman_api_version => "2", > :foreman_version => "1.5.0", > :etag => "\"6371033602a4b5f28eaf25f665395a20\"", > :apipie_checksum => "fcdc22ab0a28f9d67de798fc2a8aa6e0", > :x_request_id => "fbadc9821ef7d9bce418131992f7d3cc" > } > > > [ERROR 2014-05-27 09:44:29 Exception] Error: Received data of unknown format > Could not create the config template: > Error: Received data of unknown format > [ERROR 2014-05-27 09:44:29 Exception] > > RuntimeError (Received data of unknown format): > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > `collection_to_common_format' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > `option_template_kind_id' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `send' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `get_option_value' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > `method_options' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > `execute' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > `run' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > `run' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > > Le mercredi 28 mai 2014 14:17:25 UTC+2, Petr Ruzicka a écrit : > > Hello. > > The command you mentioned is working fine for me. > > Can you please run it with "hammer --debug ..." please? > > Thank you > > PetrR > > > > On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth wrote: > > Hello, i'm trying to script my foreman install with REST Api and > Hammer CLI, but i run into a problem with template creation. > > hammer -u admin -p changeme template create --name "test" --type > "finish" --file ./test > Could not create the config template: > Error: Received data of unknown format > > Hammer log output : > > [ERROR 2014-05-27 06:46:26 Exception] Error: Received data of > unknown format > [ERROR 2014-05-27 06:46:26 Exception] > > RuntimeError (Received data of unknown format): > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > `collection_to_common_format' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > `option_template_kind_id' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `send' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > `get_option_value' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `each' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > `method_options_for_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > `method_options' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > `request_params' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > `send_request' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > `execute' > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > `run' > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > `run' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > > using versions : > > rpm -qa | grep foreman > foreman-vmware-1.5.0-1.el6.noarch > rubygem-foreman_api-0.1.11-1.el6.noarch > foreman-installer-1.5.0-1.el6.noarch > foreman-1.5.0-1.el6.noarch > foreman-compute-1.5.0-1.el6.noarch > ruby193-rubygem-foreman_bootdisk-2.0.7-1.el6.noarch > ruby193-rubygem-foreman_setup-2.0.3-1.el6.noarch > foreman-postgresql-1.5.0-1.el6.noarch > foreman-selinux-1.5.0-1.el6.noarch > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > foreman-proxy-1.5.0-1.el6.noarch > > rpm -qa | grep hammer > rubygem-hammer_cli-0.1.1-1.201405271206git41f59a5.el6.noarch > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > > Using REST Api i can create a template, but as far as i know > there's no way to give a file as template input. > > -- > You received this message because you are subscribed to the Google > Groups "Foreman users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to foreman-users+unsubscribe@googlegroups.com > . > To post to this group, send email to foreman-users@googlegroups.com > . > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.

latest stable, 1.5.0.
clould you please paste you working command as an example, and your input
file format ?
thx

··· Le jeudi 29 mai 2014 10:34:17 UTC+2, Tomas Strachota a écrit : > > Hello, > unfortunately I wasn't able to reproduce the error either. What version > is the server you run the commands against, please? > > Regards > Tomas > > On 05/28/2014 02:50 PM, Alexandre Barth wrote: > > Here is the ouptut in debug mode : > > > > hammer --debug -u admin -p changeme template create --name "test" --type > > "finish" --file ./test > > [ INFO 2014-05-27 09:44:27 Init] Initialization of Hammer CLI (0.1.1) > > has started... > > [DEBUG 2014-05-27 09:44:27 Init] Running at ruby 1.8.7-p352 > > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > > /etc/hammer/cli_config.yml has been loaded > > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > > /etc/hammer/cli.modules.d/foreman.yml has been loaded > > [DEBUG 2014-05-27 09:44:28 Connection] Registered: foreman > > [DEBUG 2014-05-27 09:44:28 API] Global headers: { > > :content_type => "application/json", > > "Accept-Language" => "en", > > :accept => "application/json;version=2" > > } > > [ INFO 2014-05-27 09:44:28 API] GET /apidoc/apipie_checksum > > [DEBUG 2014-05-27 09:44:28 API] Params: {} > > [DEBUG 2014-05-27 09:44:28 API] Headers: { > > :accept => "application/json", > > :params => {} > > } > > [DEBUG 2014-05-27 09:44:28 API] Response { > > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > } > > [ INFO 2014-05-27 09:44:29 Modules] Extension module hammer_cli_foreman > > (0.1.1) loaded > > [DEBUG 2014-05-27 09:44:29 Init] Using locale 'en' > > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > > 'hammer-cli' loaded from > > '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' > > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > > 'hammer-cli-foreman' loaded from > > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' > > [ INFO 2014-05-27 09:44:29 HammerCLI::MainCommand] Called with options: > > {"option_debug"=>true, "option_username"=>"admin", > "option_password"=>"***"} > > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template] Called with > > options: {} > > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template::CreateCommand] > > Called with options: {"option_type"=>"finish", "option_name"=>"test", > > "option_template"=>"#End of Build\r\n<%- if @host.shortname.include? > > \"log\" %>\r\necho \"fs.file-max = 65535\" >> /etc/sysctl.conf\r\necho > > \"* soft nofile 65535\" >> /etc/security/limits.conf\r\necho \"* hard > > nofile 65535\" >> /etc/security/limits.conf\r\necho \"* soft memlock > > unlimited\" >> /etc/security/limits.conf\r\necho \"* hard memlock > > unlimited\" >> /etc/security/limits.conf\r\n<%- end %>\r\nwget --quiet > > --output-document=/dev/null --no-check-certificate <%= foreman_url > > %>\r\n\r\n"} > > [ INFO 2014-05-27 09:44:29 API] GET /apidoc/apipie_checksum > > [DEBUG 2014-05-27 09:44:29 API] Params: {} > > [DEBUG 2014-05-27 09:44:29 API] Headers: { > > :accept => "application/json", > > :params => {} > > } > > [DEBUG 2014-05-27 09:44:29 API] Response { > > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > } > > [ INFO 2014-05-27 09:44:29 API] GET /api/template_kinds > > [DEBUG 2014-05-27 09:44:29 API] Params: {} > > [DEBUG 2014-05-27 09:44:29 API] Headers: { > > :params => {} > > } > > [DEBUG 2014-05-27 09:44:29 API] Response # > attr_accessor :args = { > > :method => :get, > > :headers => { > > :content_type => "application/json", > > "Accept-Language" => "en", > > :accept => "application/json;version=2" > > }, > > :timeout => nil, > > :oauth => nil, > > :url => "https://localhost//api/template_kinds", > > :user => "admin", > > :password => "changeme" > > }, > > attr_accessor :net_http_res = # > @body_exist = true, > > @read = true, > > @socket = nil, > > attr_reader :body = ...String..., > > attr_reader :code = "200", > > attr_reader :header = { > > "x-rack-cache" => [ > > [0] "miss" > > ], > > "x-runtime" => [ > > [0] "0.033649" > > ], > > "status" => [ > > [0] "200 OK" > > ], > > "foreman_api_version" => [ > > [0] "2" > > ], > > "server" => [ > > [0] "Apache/2.2.15 (CentOS)" > > ], > > "transfer-encoding" => [ > > [0] "chunked" > > ], > > "x-ua-compatible" => [ > > [0] "IE=Edge,chrome=1" > > ], > > "content-type" => [ > > [0] "application/json; charset=utf-8" > > ], > > "etag" => [ > > [0] "\"6371033602a4b5f28eaf25f665395a20\"" > > ], > > "apipie-checksum" => [ > > [0] "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > ], > > "x-request-id" => [ > > [0] "fbadc9821ef7d9bce418131992f7d3cc" > > ], > > "date" => [ > > [0] "Tue, 27 May 2014 07:44:29 GMT" > > ], > > "connection" => [ > > [0] "close" > > ], > > "x-powered-by" => [ > > [0] "Phusion Passenger 4.0.18" > > ], > > "set-cookie" => [ > > [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; > > path=/; HttpOnly" > > ], > > "cache-control" => [ > > [0] "must-revalidate, private, max-age=0" > > ], > > "foreman_version" => [ > > [0] "1.5.0" > > ] > > }, > > attr_reader :http_version = "1.1", > > attr_reader :message = "OK" > > >, > > attr_reader :code = 200, > > attr_reader :headers = { > > :status => "200 OK", > > :x_runtime => "0.033649", > > :x_powered_by => "Phusion Passenger 4.0.18", > > :content_type => "application/json; charset=utf-8", > > :set_cookie => [ > > [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; path=/; > > HttpOnly" > > ], > > :server => "Apache/2.2.15 (CentOS)", > > :x_rack_cache => "miss", > > :connection => "close", > > :cache_control => "must-revalidate, private, max-age=0", > > :x_ua_compatible => "IE=Edge,chrome=1", > > :date => "Tue, 27 May 2014 07:44:29 GMT", > > :transfer_encoding => "chunked", > > :foreman_api_version => "2", > > :foreman_version => "1.5.0", > > :etag => "\"6371033602a4b5f28eaf25f665395a20\"", > > :apipie_checksum => "fcdc22ab0a28f9d67de798fc2a8aa6e0", > > :x_request_id => "fbadc9821ef7d9bce418131992f7d3cc" > > } > > > > > [ERROR 2014-05-27 09:44:29 Exception] Error: Received data of unknown > format > > Could not create the config template: > > Error: Received data of unknown format > > [ERROR 2014-05-27 09:44:29 Exception] > > > > RuntimeError (Received data of unknown format): > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > > > `collection_to_common_format' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > > > `option_template_kind_id' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > `send' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > `get_option_value' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `each' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `each' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > > > `method_options' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > > > `request_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > > > `request_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > > > `send_request' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > > > `send_request' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > > > `execute' > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > > > `run' > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > > /usr/bin/hammer:19:in `load' > > /usr/bin/hammer:19 > > > > Le mercredi 28 mai 2014 14:17:25 UTC+2, Petr Ruzicka a écrit : > > > > Hello. > > > > The command you mentioned is working fine for me. > > > > Can you please run it with "hammer --debug ..." please? > > > > Thank you > > > > PetrR > > > > > > > > On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth wrote: > > > > Hello, i'm trying to script my foreman install with REST Api and > > Hammer CLI, but i run into a problem with template creation. > > > > hammer -u admin -p changeme template create --name "test" --type > > "finish" --file ./test > > Could not create the config template: > > Error: Received data of unknown format > > > > Hammer log output : > > > > [ERROR 2014-05-27 06:46:26 Exception] Error: Received data of > > unknown format > > [ERROR 2014-05-27 06:46:26 Exception] > > > > RuntimeError (Received data of unknown format): > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > > > `collection_to_common_format' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > > > `option_template_kind_id' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > `send' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > `get_option_value' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `each' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `each' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > `method_options_for_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > > > `method_options' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > > > `request_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > > > `request_params' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > > > `send_request' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > > > `send_request' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > > > `execute' > > > > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > > > `run' > > > > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > > `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > > /usr/bin/hammer:19:in `load' > > /usr/bin/hammer:19 > > > > using versions : > > > > rpm -qa | grep foreman > > foreman-vmware-1.5.0-1.el6.noarch > > rubygem-foreman_api-0.1.11-1.el6.noarch > > foreman-installer-1.5.0-1.el6.noarch > > foreman-1.5.0-1.el6.noarch > > foreman-compute-1.5.0-1.el6.noarch > > ruby193-rubygem-foreman_bootdisk-2.0.7-1.el6.noarch > > ruby193-rubygem-foreman_setup-2.0.3-1.el6.noarch > > foreman-postgresql-1.5.0-1.el6.noarch > > foreman-selinux-1.5.0-1.el6.noarch > > > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > > foreman-proxy-1.5.0-1.el6.noarch > > > > rpm -qa | grep hammer > > rubygem-hammer_cli-0.1.1-1.201405271206git41f59a5.el6.noarch > > > rubygem-hammer_cli_foreman-0.1.1-1.201405271211git2b64eb4.el6.noarch > > > > Using REST Api i can create a template, but as far as i know > > there's no way to give a file as template input. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Foreman users" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to foreman-user...@googlegroups.com > > <mailto:foreman-users+unsubscribe@googlegroups.com >. > > To post to this group, send email to forema...@googlegroups.com > > <mailto:forema...@googlegroups.com >. > > Visit this group at http://groups.google.com/group/foreman-users. > > For more options, visit https://groups.google.com/d/optout. > >

> latest stable, 1.5.0.
> clould you please paste you working command as an example, and your
> input file format ?
> thx

Sure, here it is:

T.

··· On 05/29/2014 01:43 PM, Alexandre Barth wrote:

Le jeudi 29 mai 2014 10:34:17 UTC+2, Tomas Strachota a écrit :

Hello,
unfortunately I wasn't able to reproduce the error either. What version
is the server you run the commands against, please?

Regards
Tomas

On 05/28/2014 02:50 PM, Alexandre Barth wrote:
 > Here is the ouptut in debug mode :
 >
 > hammer --debug -u admin -p changeme template create --name "test"
--type
 > "finish" --file ./test
 > [ INFO 2014-05-27 09:44:27 Init] Initialization of Hammer CLI
(0.1.1)
 > has started...
 > [DEBUG 2014-05-27 09:44:27 Init] Running at ruby 1.8.7-p352
 > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file
 > /etc/hammer/cli_config.yml has been loaded
 > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file
 > /etc/hammer/cli.modules.d/foreman.yml has been loaded
 > [DEBUG 2014-05-27 09:44:28 Connection] Registered: foreman
 > [DEBUG 2014-05-27 09:44:28 API] Global headers: {
 >          :content_type => "application/json",
 >      "Accept-Language" => "en",
 >                :accept => "application/json;version=2"
 > }
 > [ INFO 2014-05-27 09:44:28 API] GET /apidoc/apipie_checksum
 > [DEBUG 2014-05-27 09:44:28 API] Params: {}
 > [DEBUG 2014-05-27 09:44:28 API] Headers: {
 >      :accept => "application/json",
 >      :params => {}
 > }
 > [DEBUG 2014-05-27 09:44:28 API] Response {
 >      "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0"
 > }
 > [ INFO 2014-05-27 09:44:29 Modules] Extension module
hammer_cli_foreman
 > (0.1.1) loaded
 > [DEBUG 2014-05-27 09:44:29 Init] Using locale 'en'
 > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain
 > 'hammer-cli' loaded from
 > '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale'
 > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain
 > 'hammer-cli-foreman' loaded from
 > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale'
 > [ INFO 2014-05-27 09:44:29 HammerCLI::MainCommand] Called with
options:
 > {"option_debug"=>true, "option_username"=>"admin",
"option_password"=>"***"}
 > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template] Called with
 > options: {}
 > [ INFO 2014-05-27 09:44:29
HammerCLIForeman::Template::CreateCommand]
 > Called with options: {"option_type"=>"finish",
"option_name"=>"test",
 > "option_template"=>"#End of Build\r\n<%- if @host.shortname.include?
 > \"log\" %>\r\necho \"fs.file-max = 65535\" >>
/etc/sysctl.conf\r\necho
 > \"* soft nofile 65535\" >> /etc/security/limits.conf\r\necho \"*
hard
 > nofile 65535\" >> /etc/security/limits.conf\r\necho \"* soft memlock
 > unlimited\" >> /etc/security/limits.conf\r\necho \"* hard memlock
 > unlimited\" >> /etc/security/limits.conf\r\n<%- end %>\r\nwget
--quiet
 > --output-document=/dev/null --no-check-certificate <%= foreman_url
 > %>\r\n\r\n"}
 > [ INFO 2014-05-27 09:44:29 API] GET /apidoc/apipie_checksum
 > [DEBUG 2014-05-27 09:44:29 API] Params: {}
 > [DEBUG 2014-05-27 09:44:29 API] Headers: {
 >      :accept => "application/json",
 >      :params => {}
 > }
 > [DEBUG 2014-05-27 09:44:29 API] Response {
 >      "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0"
 > }
 > [ INFO 2014-05-27 09:44:29 API] GET /api/template_kinds
 > [DEBUG 2014-05-27 09:44:29 API] Params: {}
 > [DEBUG 2014-05-27 09:44:29 API] Headers: {
 >      :params => {}
 > }
 > [DEBUG 2014-05-27 09:44:29 API] Response #<String:0x7f9c297551f8
 >      attr_accessor :args = {
 >            :method => :get,
 >           :headers => {
 >                  :content_type => "application/json",
 >              "Accept-Language" => "en",
 >                        :accept => "application/json;version=2"
 >          },
 >           :timeout => nil,
 >             :oauth => nil,
 >               :url => "https://localhost//api/template_kinds
<https://localhost//api/template_kinds>",
 >              :user => "admin",
 >          :password => "changeme"
 >      },
 >      attr_accessor :net_http_res = #<Net::HTTPOK:0x7f9c29758510
 >          @body_exist = true,
 >          @read = true,
 >          @socket = nil,
 >          attr_reader :body = ...String...,
 >          attr_reader :code = "200",
 >          attr_reader :header = {
 >                     "x-rack-cache" => [
 >                  [0] "miss"
 >              ],
 >                        "x-runtime" => [
 >                  [0] "0.033649"
 >              ],
 >                           "status" => [
 >                  [0] "200 OK"
 >              ],
 >              "foreman_api_version" => [
 >                  [0] "2"
 >              ],
 >                           "server" => [
 >                  [0] "Apache/2.2.15 (CentOS)"
 >              ],
 >                "transfer-encoding" => [
 >                  [0] "chunked"
 >              ],
 >                  "x-ua-compatible" => [
 >                  [0] "IE=Edge,chrome=1"
 >              ],
 >                     "content-type" => [
 >                  [0] "application/json; charset=utf-8"
 >              ],
 >                             "etag" => [
 >                  [0] "\"6371033602a4b5f28eaf25f665395a20\""
 >              ],
 >                  "apipie-checksum" => [
 >                  [0] "fcdc22ab0a28f9d67de798fc2a8aa6e0"
 >              ],
 >                     "x-request-id" => [
 >                  [0] "fbadc9821ef7d9bce418131992f7d3cc"
 >              ],
 >                             "date" => [
 >                  [0] "Tue, 27 May 2014 07:44:29 GMT"
 >              ],
 >                       "connection" => [
 >                  [0] "close"
 >              ],
 >                     "x-powered-by" => [
 >                  [0] "Phusion Passenger 4.0.18"
 >              ],
 >                       "set-cookie" => [
 >                  [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80;
 > path=/; HttpOnly"
 >              ],
 >                    "cache-control" => [
 >                  [0] "must-revalidate, private, max-age=0"
 >              ],
 >                  "foreman_version" => [
 >                  [0] "1.5.0"
 >              ]
 >          },
 >          attr_reader :http_version = "1.1",
 >          attr_reader :message = "OK"
 >      >,
 >      attr_reader :code = 200,
 >      attr_reader :headers = {
 >                       :status => "200 OK",
 >                    :x_runtime => "0.033649",
 >                 :x_powered_by => "Phusion Passenger 4.0.18",
 >                 :content_type => "application/json; charset=utf-8",
 >                   :set_cookie => [
 >              [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80;
path=/;
 > HttpOnly"
 >          ],
 >                       :server => "Apache/2.2.15 (CentOS)",
 >                 :x_rack_cache => "miss",
 >                   :connection => "close",
 >                :cache_control => "must-revalidate, private,
max-age=0",
 >              :x_ua_compatible => "IE=Edge,chrome=1",
 >                         :date => "Tue, 27 May 2014 07:44:29 GMT",
 >            :transfer_encoding => "chunked",
 >          :foreman_api_version => "2",
 >              :foreman_version => "1.5.0",
 >                         :etag =>
"\"6371033602a4b5f28eaf25f665395a20\"",
 >              :apipie_checksum => "fcdc22ab0a28f9d67de798fc2a8aa6e0",
 >                 :x_request_id => "fbadc9821ef7d9bce418131992f7d3cc"
 >      }
 >  >
 > [ERROR 2014-05-27 09:44:29 Exception] Error: Received data of
unknown format
 > Could not create the config template:
 >    Error: Received data of unknown format
 > [ERROR 2014-05-27 09:44:29 Exception]
 >
 > RuntimeError (Received data of unknown format):
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in

 > `collection_to_common_format'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in

 > `option_template_kind_id'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in

 > `send'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in

 > `get_option_value'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in

 > `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 > `each'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 > `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in

 > `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 > `each'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 > `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in

 > `method_options'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in

 > `request_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in

 > `request_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in

 > `send_request'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in

 > `send_request'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in

 > `execute'
 >
  /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in
 > `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in
 > `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in
 > `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in

 > `run'
 >
  /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in
 > `run'
 >      /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
 >      /usr/bin/hammer:19:in `load'
 >      /usr/bin/hammer:19
 >
 > Le mercredi 28 mai 2014 14:17:25 UTC+2, Petr Ruzicka a écrit :
 >
 >     Hello.
 >
 >     The command you mentioned is working fine for me.
 >
 >     Can you please run it with "hammer --debug ..." please?
 >
 >     Thank you
 >
 >     PetrR
 >
 >
 >
 >     On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth wrote:
 >
 >         Hello, i'm trying to script my foreman install with REST
Api and
 >         Hammer CLI, but i run into a problem with template creation.
 >
 >         hammer -u admin -p changeme template create --name "test"
--type
 >         "finish" --file ./test
 >         Could not create the config template:
 >            Error: Received data of unknown format
 >
 >         Hammer log output :
 >
 >         [ERROR 2014-05-27 06:46:26 Exception] Error: Received
data of
 >         unknown format
 >         [ERROR 2014-05-27 06:46:26 Exception]
 >
 >         RuntimeError (Received data of unknown format):
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in

 >         `collection_to_common_format'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in

 >         `option_template_kind_id'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in

 >         `send'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in

 >         `get_option_value'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in

 >         `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 >         `each'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 >         `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in

 >         `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 >         `each'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in

 >         `method_options_for_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in

 >         `method_options'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in

 >         `request_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in

 >         `request_params'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in

 >         `send_request'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in

 >         `send_request'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in

 >         `execute'
 >
 >
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in
 >         `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in
 >         `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in
 >         `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in

 >         `run'
 >
 >
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in
 >         `run'
 >
  /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100
 >              /usr/bin/hammer:19:in `load'
 >              /usr/bin/hammer:19
 >
 >         using versions :
 >
 >         rpm -qa | grep foreman
 >         foreman-vmware-1.5.0-1.el6.noarch
 >         rubygem-foreman_api-0.1.11-1.e

It is now working, thx for your help, i had a bad file format.

··· Le vendredi 30 mai 2014 14:56:17 UTC+2, Tomas Strachota a écrit : > > On 05/29/2014 01:43 PM, Alexandre Barth wrote: > > latest stable, 1.5.0. > > clould you please paste you working command as an example, and your > > input file format ? > > thx > > Sure, here it is: > - the command log: http://ur1.ca/hewtt > - the template used: http://ur1.ca/hewtv > I execute: > hammer -d template create --name "test" --type "finish" --file > ~/test_template_dos.txt > > T. > > > > > Le jeudi 29 mai 2014 10:34:17 UTC+2, Tomas Strachota a écrit : > > > > Hello, > > unfortunately I wasn't able to reproduce the error either. What > version > > is the server you run the commands against, please? > > > > Regards > > Tomas > > > > On 05/28/2014 02:50 PM, Alexandre Barth wrote: > > > Here is the ouptut in debug mode : > > > > > > hammer --debug -u admin -p changeme template create --name "test" > > --type > > > "finish" --file ./test > > > [ INFO 2014-05-27 09:44:27 Init] Initialization of Hammer CLI > > (0.1.1) > > > has started... > > > [DEBUG 2014-05-27 09:44:27 Init] Running at ruby 1.8.7-p352 > > > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > > > /etc/hammer/cli_config.yml has been loaded > > > [ INFO 2014-05-27 09:44:27 Init] Configuration from the file > > > /etc/hammer/cli.modules.d/foreman.yml has been loaded > > > [DEBUG 2014-05-27 09:44:28 Connection] Registered: foreman > > > [DEBUG 2014-05-27 09:44:28 API] Global headers: { > > > :content_type => "application/json", > > > "Accept-Language" => "en", > > > :accept => "application/json;version=2" > > > } > > > [ INFO 2014-05-27 09:44:28 API] GET /apidoc/apipie_checksum > > > [DEBUG 2014-05-27 09:44:28 API] Params: {} > > > [DEBUG 2014-05-27 09:44:28 API] Headers: { > > > :accept => "application/json", > > > :params => {} > > > } > > > [DEBUG 2014-05-27 09:44:28 API] Response { > > > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > > } > > > [ INFO 2014-05-27 09:44:29 Modules] Extension module > > hammer_cli_foreman > > > (0.1.1) loaded > > > [DEBUG 2014-05-27 09:44:29 Init] Using locale 'en' > > > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > > > 'hammer-cli' loaded from > > > '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' > > > [DEBUG 2014-05-27 09:44:29 Init] 'mo' files for locale domain > > > 'hammer-cli-foreman' loaded from > > > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' > > > [ INFO 2014-05-27 09:44:29 HammerCLI::MainCommand] Called with > > options: > > > {"option_debug"=>true, "option_username"=>"admin", > > "option_password"=>"***"} > > > [ INFO 2014-05-27 09:44:29 HammerCLIForeman::Template] Called > with > > > options: {} > > > [ INFO 2014-05-27 09:44:29 > > HammerCLIForeman::Template::CreateCommand] > > > Called with options: {"option_type"=>"finish", > > "option_name"=>"test", > > > "option_template"=>"#End of Build\r\n<%- if > @host.shortname.include? > > > \"log\" %>\r\necho \"fs.file-max = 65535\" >> > > /etc/sysctl.conf\r\necho > > > \"* soft nofile 65535\" >> /etc/security/limits.conf\r\necho \"* > > hard > > > nofile 65535\" >> /etc/security/limits.conf\r\necho \"* soft > memlock > > > unlimited\" >> /etc/security/limits.conf\r\necho \"* hard memlock > > > unlimited\" >> /etc/security/limits.conf\r\n<%- end %>\r\nwget > > --quiet > > > --output-document=/dev/null --no-check-certificate <%= > foreman_url > > > %>\r\n\r\n"} > > > [ INFO 2014-05-27 09:44:29 API] GET /apidoc/apipie_checksum > > > [DEBUG 2014-05-27 09:44:29 API] Params: {} > > > [DEBUG 2014-05-27 09:44:29 API] Headers: { > > > :accept => "application/json", > > > :params => {} > > > } > > > [DEBUG 2014-05-27 09:44:29 API] Response { > > > "checksum" => "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > > } > > > [ INFO 2014-05-27 09:44:29 API] GET /api/template_kinds > > > [DEBUG 2014-05-27 09:44:29 API] Params: {} > > > [DEBUG 2014-05-27 09:44:29 API] Headers: { > > > :params => {} > > > } > > > [DEBUG 2014-05-27 09:44:29 API] Response # > > attr_accessor :args = { > > > :method => :get, > > > :headers => { > > > :content_type => "application/json", > > > "Accept-Language" => "en", > > > :accept => "application/json;version=2" > > > }, > > > :timeout => nil, > > > :oauth => nil, > > > :url => "https://localhost//api/template_kinds > > ", > > > :user => "admin", > > > :password => "changeme" > > > }, > > > attr_accessor :net_http_res = # > > @body_exist = true, > > > @read = true, > > > @socket = nil, > > > attr_reader :body = ...String..., > > > attr_reader :code = "200", > > > attr_reader :header = { > > > "x-rack-cache" => [ > > > [0] "miss" > > > ], > > > "x-runtime" => [ > > > [0] "0.033649" > > > ], > > > "status" => [ > > > [0] "200 OK" > > > ], > > > "foreman_api_version" => [ > > > [0] "2" > > > ], > > > "server" => [ > > > [0] "Apache/2.2.15 (CentOS)" > > > ], > > > "transfer-encoding" => [ > > > [0] "chunked" > > > ], > > > "x-ua-compatible" => [ > > > [0] "IE=Edge,chrome=1" > > > ], > > > "content-type" => [ > > > [0] "application/json; charset=utf-8" > > > ], > > > "etag" => [ > > > [0] "\"6371033602a4b5f28eaf25f665395a20\"" > > > ], > > > "apipie-checksum" => [ > > > [0] "fcdc22ab0a28f9d67de798fc2a8aa6e0" > > > ], > > > "x-request-id" => [ > > > [0] "fbadc9821ef7d9bce418131992f7d3cc" > > > ], > > > "date" => [ > > > [0] "Tue, 27 May 2014 07:44:29 GMT" > > > ], > > > "connection" => [ > > > [0] "close" > > > ], > > > "x-powered-by" => [ > > > [0] "Phusion Passenger 4.0.18" > > > ], > > > "set-cookie" => [ > > > [0] > "_session_id=ec57c5a522b31d0bc2199bc59b222d80; > > > path=/; HttpOnly" > > > ], > > > "cache-control" => [ > > > [0] "must-revalidate, private, max-age=0" > > > ], > > > "foreman_version" => [ > > > [0] "1.5.0" > > > ] > > > }, > > > attr_reader :http_version = "1.1", > > > attr_reader :message = "OK" > > > >, > > > attr_reader :code = 200, > > > attr_reader :headers = { > > > :status => "200 OK", > > > :x_runtime => "0.033649", > > > :x_powered_by => "Phusion Passenger 4.0.18", > > > :content_type => "application/json; > charset=utf-8", > > > :set_cookie => [ > > > [0] "_session_id=ec57c5a522b31d0bc2199bc59b222d80; > > path=/; > > > HttpOnly" > > > ], > > > :server => "Apache/2.2.15 (CentOS)", > > > :x_rack_cache => "miss", > > > :connection => "close", > > > :cache_control => "must-revalidate, private, > > max-age=0", > > > :x_ua_compatible => "IE=Edge,chrome=1", > > > :date => "Tue, 27 May 2014 07:44:29 GMT", > > > :transfer_encoding => "chunked", > > > :foreman_api_version => "2", > > > :foreman_version => "1.5.0", > > > :etag => > > "\"6371033602a4b5f28eaf25f665395a20\"", > > > :apipie_checksum => > "fcdc22ab0a28f9d67de798fc2a8aa6e0", > > > :x_request_id => > "fbadc9821ef7d9bce418131992f7d3cc" > > > } > > > > > > > [ERROR 2014-05-27 09:44:29 Exception] Error: Received data of > > unknown format > > > Could not create the config template: > > > Error: Received data of unknown format > > > [ERROR 2014-05-27 09:44:29 Exception] > > > > > > RuntimeError (Received data of unknown format): > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > > > > > > `collection_to_common_format' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > > > > > > `option_template_kind_id' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > > > > `send' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > > > > `get_option_value' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `each' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `each' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > > > > > > `method_options' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > > > > > > `request_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > > > > > > `request_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:42:in > > > > > > `send_request' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:113:in > > > > > > `send_request' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:33:in > > > > > > `execute' > > > > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > > > `run' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > > `run' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22: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:67:in > > > `run' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/../abstract.rb:22:in > > > > > > `run' > > > > > > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in > > > `run' > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:100 > > > /usr/bin/hammer:19:in `load' > > > /usr/bin/hammer:19 > > > > > > Le mercredi 28 mai 2014 14:17:25 UTC+2, Petr Ruzicka a écrit : > > > > > > Hello. > > > > > > The command you mentioned is working fine for me. > > > > > > Can you please run it with "hammer --debug ..." please? > > > > > > Thank you > > > > > > PetrR > > > > > > > > > > > > On Wednesday, 28 May 2014 11:44:24 UTC+2, Alexandre Barth > wrote: > > > > > > Hello, i'm trying to script my foreman install with REST > > Api and > > > Hammer CLI, but i run into a problem with template > creation. > > > > > > hammer -u admin -p changeme template create --name "test" > > --type > > > "finish" --file ./test > > > Could not create the config template: > > > Error: Received data of unknown format > > > > > > Hammer log output : > > > > > > [ERROR 2014-05-27 06:46:26 Exception] Error: Received > > data of > > > unknown format > > > [ERROR 2014-05-27 06:46:26 Exception] > > > > > > RuntimeError (Received data of unknown format): > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:56:in > > > > > > `collection_to_common_format' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/template.rb:14:in > > > > > > `option_template_kind_id' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > > > > `send' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:29:in > > > > > > `get_option_value' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:19:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `each' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:17:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `each' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:15:in > > > > > > `method_options_for_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/options.rb:10:in > > > > > > `method_options' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/command.rb:53:in > > > > > > `request_params' > > > > > > > > > /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/lib/hammer_cli_foreman/commands.rb:117:in > > > > > > `request_params' > > > > > > > > > /usr/lib/ruby/gems/