Project

General

Profile

Actions

Bug #14728

open

CLI parses "bootdisk host --full false" as true

Added by Lukas Zapletal over 7 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When using the bootdisk host subcommand with --full false, the argument is passed as a string to the API, which is interpreted as true. This causes a full image to be downloaded.

$ be hammer -d bootdisk host --full false --host wstest.example.com
[ INFO 2016-04-20T10:58:49 Init] Initialization of Hammer CLI (0.6.0) has started...
[DEBUG 2016-04-20T10:58:49 Init] Running at ruby 2.0.0-p247
[ INFO 2016-04-20T10:58:49 Init] Configuration from the file /home/dcleal/.hammer/cli_config.yml has been loaded
[ WARN 2016-04-20T10:58:50 Modules] >Legacy configuration of modules detected. Check section about configuration in user manual<
[DEBUG 2016-04-20T10:58:50 Connection] Registered: foreman
[DEBUG 2016-04-20T10:58:50 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en_GB" 
}
[DEBUG 2016-04-20T10:58:50 API] Follow redirects: default
[ INFO 2016-04-20T10:58:50 Modules] Extension module hammer_cli_foreman (0.6.1) loaded
[ INFO 2016-04-20T10:58:50 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[DEBUG 2016-04-20T10:58:50 Init] Using locale 'en_GB'
[DEBUG 2016-04-20T10:58:50 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/home/dcleal/code/foreman/hammer-cli/locale'
[DEBUG 2016-04-20T10:58:50 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/home/dcleal/code/foreman/hammer-cli-foreman/locale'
[ INFO 2016-04-20T10:58:50 HammerCLI::MainCommand] Called with options: {"option_debug"=>true}
[ INFO 2016-04-20T10:58:50 HammerCLIForemanBootdisk::Bootdisk] Called with options: {}
[ INFO 2016-04-20T10:58:50 HammerCLIForemanBootdisk::Bootdisk::HostCommand] Called with options: {"option_host_name"=>"wstest.example.com", "option_full"=>"false"}
...
[ INFO 2016-04-20T10:58:50 API] Server: http://localhost:3000/
[ INFO 2016-04-20T10:58:50 API] GET /bootdisk/api/hosts/118
[DEBUG 2016-04-20T10:58:50 API] Params: {
    "full" => "false" 
}
[DEBUG 2016-04-20T10:58:50 API] Headers: {
    :params => {
        "full" => "false" 
    }
}
2016-04-20T10:58:50 [app] [I] Started GET "/bootdisk/api/hosts/118?full=false" for 127.0.0.1 at 2016-04-20 10:58:50 +0100
2016-04-20T10:58:50 [app] [I] Processing by ForemanBootdisk::Api::V2::DisksController#host as JSON
2016-04-20T10:58:50 [app] [I]   Parameters: {"full"=>"false", "apiv"=>"v2", "id"=>"118", "disk"=>{}}

Note the value is a string, not bool.

Actions #1

Updated by Dominic Cleal over 7 years ago

Can you please describe the issue?

Actions #2

Updated by Dominic Cleal over 7 years ago

  • Subject changed from CLI does not correctly parse "--full false" to CLI parses "bootdisk host --full false" as true
  • Description updated (diff)

Ok, I guess you mean that it's actually requesting a full image when the flag is set to false. The CLI is missing a boolean normaliser or similar on the option, causing it to be sent as a string.

Actions #3

Updated by Rahul Bajaj over 5 years ago

  • Assignee set to Rahul Bajaj
Actions #4

Updated by Rahul Bajaj over 4 years ago

  • Assignee deleted (Rahul Bajaj)
Actions

Also available in: Atom PDF