Project

General

Custom queries

Profile

Actions

Bug #8244

closed

hammer host update can't update host environment id

Added by Stephen Benjamin over 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Hosts
Target version:
-
Difficulty:
Triaged:
No
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:
yes

Description

It looks like it's searching the environment:

[root@katello-centos6-bats ~]# hammer -u admin -p changeme host update --name katello-centos6-bats.example.com --environment-id=$target_env --puppetclass-ids=1
Could not update the host:
Error: host not found

Debug

[ INFO 2014-11-03 13:22:21 Init] Initialization of Hammer CLI (0.1.3) has started...
[DEBUG 2014-11-03 13:22:21 Init] Running at ruby 1.8.7-p374
[ INFO 2014-11-03 13:22:21 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2014-11-03 13:22:21 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-11-03 13:22:21 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2014-11-03 13:22:21 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:67: warning: already initialized constant DEFAULT_LABEL_INDENT
[DEBUG 2014-11-03 13:22:21 Connection] Registered: foreman
[DEBUG 2014-11-03 13:22:21 API] Global headers: {
:content_type => "application/json",
"Accept-Language" => "en",
:accept => "application/json;version=2" 
}
[ INFO 2014-11-03 13:22:21 Modules] Extension module hammer_cli_foreman (0.1.3) loaded
[ INFO 2014-11-03 13:22:21 Modules] Extension module hammer_cli_import (0.10.4) loaded
[ INFO 2014-11-03 13:22:21 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2014-11-03 13:22:21 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2014-11-03 13:22:21 Modules] Extension module hammer_cli_katello (0.0.6) loaded
[DEBUG 2014-11-03 13:22:21 Init] Using locale 'en'
[DEBUG 2014-11-03 13:22:21 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-11-03 13:22:21 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2014-11-03 13:22:21 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-11-03 13:22:21 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2014-11-03 13:22:21 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.6/locale'
[ INFO 2014-11-03 13:22:21 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2014-11-03 13:22:21 HammerCLIForeman::Host] Called with options: {}
[ INFO 2014-11-03 13:22:21 HammerCLIForeman::Host::UpdateCommand] Called with options: {"option_interface_list"=>[], "option_volume_list"=>[], "option_puppetclass_ids"=>["1"], "option_environment_id"=>"3", "option_name"=>"katello-centos6-bats.example.com"}
[ INFO 2014-11-03 13:22:22 API] GET /api/environments/3/hosts
[DEBUG 2014-11-03 13:22:22 API] Params: {
:search => "name = \"katello-centos6-bats.example.com\"" 
}
[DEBUG 2014-11-03 13:22:22 API] Headers: {
:params => {
:search => "name = \"katello-centos6-bats.example.com\"" 
}
}
[DEBUG 2014-11-03 13:22:22 API] Response: {
"page" => 1,
"sort" => {
"order" => nil,
"by" => nil
},
"per_page" => 20,
"results" => [],
"total" => 0,
"search" => "name = \"katello-centos6-bats.example.com\"",
"subtotal" => 0
}
[DEBUG 2014-11-03 13:22:22 API] Response headers: {
:content_type => "application/json; charset=utf-8",
:status => "200 OK",
:cache_control => "must-revalidate, private, max-age=0",
:x_ua_compatible => "IE=Edge,chrome=1",
:foreman_api_version => "2",
:x_powered_by => "Phusion Passenger 4.0.18",
:etag => "\"ee20498d65c5c4c413ee48645d82b1d6\"",
:transfer_encoding => "chunked",
:x_rack_cache => "miss",
:x_request_id => "fcdd837f62d22d037848e5e730f3fb09",
:date => "Mon, 03 Nov 2014 13:22:22 GMT",
:server => "Apache/2.2.15 (CentOS)",
:connection => "close",
:foreman_version => "1.8.0-develop",
:apipie_checksum => "fece31999c43f6cab1b0ca0bafd12626",
:set_cookie => [
[0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTYyMzE5OGE1NjRmMTIxMjA5NWY2Nzc1N2I3MGViOWRhBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--d49888f02717b691e96c82969f0f0540f204bcf4; path=/; HttpOnly" 
],
:x_runtime => "0.045946" 
}
[ERROR 2014-11-03 13:22:22 Exception] Error: host not found
Could not update the host:
Error: host not found
[ERROR 2014-11-03 13:22:22 Exception]

HammerCLIForeman::ResolverError (host not found):
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:140:in pick_result' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:136:infind_resource'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:114:in get_id' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/id_resolver.rb:108:inhost_id'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:143:in send' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:143:inget_resource_id'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:132:in get_identifier' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:180:incustomized_options'
/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:185:in request_params' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/host.rb:66:inrequest_params'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:42:in send_request' /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.3/lib/hammer_cli_foreman/commands.rb:164:insend_request'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/command.rb:33:in execute' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:68:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/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:inexecute'
/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:22:inrun'
/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:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/lib/hammer_cli/./apipie/../abstract.rb:22:in run' /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:126:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.3/bin/hammer:106
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19

Actions #1

Updated by Ori Rabin over 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin
Actions #2

Updated by Ori Rabin over 10 years ago

  • Project changed from Hammer CLI to Foreman
  • Subject changed from hammer host update can't update host environment id to api host update can't update host environment id
  • Category changed from Foreman commands (obsolete) to API
Actions #3

Updated by Ori Rabin over 10 years ago

  • Project changed from Foreman to Hammer CLI
  • Category changed from API to Foreman commands (obsolete)
Actions #4

Updated by Ori Rabin over 10 years ago

  • Subject changed from api host update can't update host environment id to hammer host update can't update host environment id
Actions #5

Updated by Ori Rabin over 10 years ago

  • Status changed from Assigned to New
  • Assignee deleted (Ori Rabin)

removing myself because this is already being investigated

Actions #6

Updated by Martin Bacovsky over 10 years ago

  • Assignee set to Tomáš Strachota
Actions #7

Updated by Tomáš Strachota over 9 years ago

  • Target version set to hammer-cli 0.6.0
Actions #8

Updated by Tomáš Strachota about 9 years ago

  • Target version changed from hammer-cli 0.6.0 to hammer-cli 0.7.0
Actions #9

Updated by Tomáš Strachota almost 8 years ago

  • Target version deleted (hammer-cli 0.7.0)
Actions #10

Updated by Tomáš Strachota about 7 years ago

  • Category changed from Foreman commands (obsolete) to Hosts
Actions #11

Updated by Shira Maximov over 5 years ago

  • Assignee deleted (Tomáš Strachota)
Actions #12

Updated by Shira Maximov over 5 years ago

  • In Kanboard set to yes
Actions #13

Updated by Shira Maximov over 5 years ago

  • Status changed from New to Closed

I believe this issue was resolved already.
The update works fine to me:
hammer -d host update --name "shirar.redhat.tlv.com" --environment-id 1

result:
Host updated.

Since the bug was opened 5 years ago And I'm not able to reproduce it, I'm closing this issue, if you the issue is still relevant, please re-open it.

Actions

Also available in: Atom PDF