Bug #4201

can't update operating system by label

Added by Martin Bacovsky almost 4 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Joseph Magen
Category:API
Target version:Sprint 21
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

Description

note that parameter is searched by name actualy

hammer -v os info --label "Fedora 19" 
[ INFO 2014-01-28 14:24:22 Init] Initialization of Hammer CLI (0.0.16) has started...
[ INFO 2014-01-28 14:24:22 Init] Configuration from the file /etc/foreman/cli_config.yml has been loaded
[ INFO 2014-01-28 14:24:22 Init] Configuration from the file /home/mbacovsk/.foreman/cli_config.yml has been loaded
[ INFO 2014-01-28 14:24:22 Modules] Extension module hammer_cli_foreman (0.0.17) loaded
[ INFO 2014-01-28 14:24:22 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true}
[ INFO 2014-01-28 14:24:22 HammerCLIForeman::OperatingSystem] Called with options: {}
[DEBUG 2014-01-28 14:24:22 ForemanApi::Resources::OperatingSystem] Calling 'index' with params {
    :search => "name = Fedora 19" 
}
[DEBUG 2014-01-28 14:24:22 ForemanApi::Resources::OperatingSystem] Method 'index' responded with {
       "total" => 2,
    "subtotal" => 0,
        "page" => 1,
    "per_page" => 20,
      "search" => "name = Fedora 19",
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => []
}
[ERROR 2014-01-28 14:24:22 Exception] Error: operatingsystem with label 'Fedora 19' not found
Error: operatingsystem with label 'Fedora 19' not found
[ERROR 2014-01-28 14:24:22 Exception] 

RuntimeError (operatingsystem with label 'Fedora 19' not found):
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/apipie/command.rb:88:in `name_to_id'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/apipie/command.rb:80:in `block in identifier_option'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:210:in `instance_exec'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:210:in `block in define_simple_writer_for'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/attribute/instance.rb:62:in `take'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/option/parsing.rb:32:in `parse_options'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/command.rb:52:in `parse'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:30:in `parse'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/command.rb:66:in `run'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/subcommand/execution.rb:11:in `execute'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/command.rb:67:in `run'
    /home/mbacovsk/work/theforeman/hammer-cli/lib/hammer_cli/abstract.rb:22:in `run'
    /home/mbacovsk/.gem/ruby/gems/clamp-0.6.3/lib/clamp/command.rb:125:in `run'
    /home/mbacovsk/work/theforeman/hammer-cli/bin/hammer:61:in `<top (required)>'
    /home/mbacovsk/.gem/ruby/bin/hammer:23:in `load'
    /home/mbacovsk/.gem/ruby/bin/hammer:23:in `<main>'

Associated revisions

Revision 42c9541f
Added by Joseph Magen over 3 years ago

fixes #4201 - update operating system by label, use description or fallname otherwise

History

#1 Updated by Joseph Magen almost 4 years ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Joseph Magen

https://github.com/theforeman/foreman/pull/1225

can now update by `to_label` which is description (if it exists) or fullname (if description does not exist)

#2 Updated by Dominic Cleal almost 4 years ago

  • Target version set to Sprint 20

#3 Updated by Dominic Cleal almost 4 years ago

  • Project changed from Hammer CLI to Foreman
  • Category changed from Foreman commands to API

#5 Updated by Dmitri Dolguikh over 3 years ago

  • Target version changed from Sprint 20 to Sprint 21

#6 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.0

#7 Updated by Joseph Magen over 3 years ago

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

Also available in: Atom PDF