Project

General

Profile

Bug #3954

Info commands must always use IDs instead of names in api calls

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

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

Description

Info commands allow to search resources by both --id and --name. API currently allows to search by either of them, which does not always work as expected. See #3876 for details.
When the --name is passed we need to perform search by name first and then use the found ID in the api show call.


Related issues

Related to Foreman - Bug #3876: API find_resource by name finds by ID instead when first character of name is a digitClosed2013-12-13

Associated revisions

Revision 5dce1255 (diff)
Added by Tomas Strachota over 6 years ago

Fixes #3954 - translate names to ids

Revision 62845e9a (diff)
Added by Tomas Strachota over 6 years ago

Fixes #3954 - translate names to ids

Revision 35c206ff
Added by mbacovsky over 6 years ago

Merge pull request #75 from tstrachota/3954_ids

Fixes #3954 - translate names to ids

Revision 41b694a7
Added by mbacovsky over 6 years ago

Merge pull request #77 from tstrachota/3954_ids

Fixes #3954 - translate names to ids

History

#1 Updated by Tomáš Strachota over 6 years ago

  • Subject changed from Info commands must always use IDs insteda of names in api calls to Info commands must always use IDs instead of names in api calls

#2 Updated by Tomáš Strachota over 6 years ago

  • Related to Bug #3876: API find_resource by name finds by ID instead when first character of name is a digit added

#3 Updated by Tomáš Strachota over 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Tomáš Strachota
  • Target version set to 1.9.2

#4 Updated by Tomáš Strachota over 6 years ago

Waiting for http://projects.theforeman.org/issues/3897 as it will be much easier to fix with. I've got the fix ready in a branch, will create a PR once the mentioned issue gets merged.

#6 Updated by Anonymous over 6 years ago

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

Applied in changeset foreman:hammer-cli|commit:62845e9a20cc942d01f64be52b59b4227340fa04.

Also available in: Atom PDF