Actions
Bug #17920
closedDefaults match on iternal option name, not on the flag name
Status:
Closed
Priority:
Normal
Assignee:
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Marek
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:
- Create Org1, Org2
- Create users jane in Org1 and john in Org2
- Save defaults for --organization:
hammer defaults add --param-name organization --param-value Org1
- 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
Actions