Project

General

Profile

Actions

Bug #17920

closed

Defaults match on iternal option name, not on the flag name

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

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

Description

Some options in hammer use internally option name different from the flag that is presented to users. Eg. all expanded resource identifiers:

--organization -> option_organization_name
--location -> option_location_name

Defaults match on the internal name instead of the flag, which is counter-intuitive.

Steps to reproduce:
  1. Create Org1, Org2
  2. Create users jane in Org1 and john in Org2
  3. Save defaults for --organization:
    hammer defaults add --param-name organization --param-value Org1
    
  4. List users:
    hammer user list
    

Actual results:
Ignores saved defaults and prints all users regardless the organization.

Expected results:
Should print only users from Org1

Additional info:
Default value is ignored because it hammer tries to look for "organization_name" and the key in defaults is "organization". Everything works when you save "organization_name" but it's counter-intuitive:

hammer defaults add --param-name organization_name --param-value Org1


Related issues 1 (0 open1 closed)

Blocked by Katello - Bug #19079: Adapt hammer-cli-katello to use the new options changes in hammer-cliClosedAndrew Kofink03/29/2017Actions
Actions #1

Updated by Tomáš Strachota about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
Actions #2

Updated by The Foreman Bot about 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli/pull/233 added
Actions #3

Updated by Tomáš Strachota about 7 years ago

  • translation missing: en.field_release set to 233
Actions #4

Updated by Anonymous about 7 years ago

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

Updated by Andrew Kofink about 7 years ago

  • Blocked by Bug #19079: Adapt hammer-cli-katello to use the new options changes in hammer-cli added
Actions

Also available in: Atom PDF