Project

General

Profile

Actions

Bug #17936

closed

Fetching default org/loc from server fails

Added by Tomáš Strachota over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

An attempt to get user's default organization or location from server ends up with no method exception.
Credentials were removed with the api sessions re-work.

Steps to reproduce:

> hammer defaults add --param-name organization_id --provider foreman
Added organization_id default-option with value that will be generated from the server.
> hammer defaults list
----------------|---------------------
PARAMETER       | VALUE               
----------------|---------------------
organization_id | Provided by: Foreman
> hammer user list
Error: undefined method `credentials' for HammerCLIForeman:Module

NoMethodError (undefined method `credentials' for HammerCLIForeman:Module):
    /root/hammer/hammer-cli-foreman/lib/hammer_cli_foreman/defaults.rb:24:in `get_user'
    /root/hammer/hammer-cli-foreman/lib/hammer_cli_foreman/defaults.rb:13:in `get_defaults'
    /root/hammer/hammer-cli/lib/hammer_cli/defaults.rb:54:in `get_defaults'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:243:in `add_custom_defaults'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:229:in `block in all_options'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:227:in `each'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:227:in `inject'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:227:in `all_options'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:236:in `options'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:34:in `parse'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/command.rb:62:in `run'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:24:in `run'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/command.rb:63:in `run'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:24:in `run'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/command.rb:63:in `run'
    /root/hammer/hammer-cli/lib/hammer_cli/abstract.rb:24:in `run'
    /usr/local/rvm/gems/ruby-2.3.0/gems/clamp-1.1.1/lib/clamp/command.rb:132:in `run'
    ./bin/hammer:125:in `<main>'
Actions

Also available in: Atom PDF