Project

General

Profile

Actions

Bug #3876

closed

API find_resource by name finds by ID instead when first character of name is a digit

Added by Og Maciel over 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Noticed that every now and than the Info subcommand for Model returns incorrect results:

DEBUG base:188: LANG=en_US hammer -u admin -p changeme model create --info --hardware-model --name='2ez0obdv' --vendor-class='vafqv7gd'
DEBUG base:191: Hardware model created

DEBUG base:188: LANG=en_US hammer -u admin -p changeme --output csv model info --name='2ez0obdv'
DEBUG base:191: Id,Name,Vendor class,HW model,Info,Created at,Updated at
2,nz1e,"","",--hardware-model,2013/12/13 16:21:53,2013/12/13 16:21:53

F
======================================================================
FAIL: test_create_model_2 (tests.cli.test_model.TestModel)
Create model with specific vendor class
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/omaciel/hacking/robottelo/tests/cli/test_model.py", line 26, in test_create_model_2
    self.assertEqual(result['vendor-class'], model.stdout['Vendor class'])
AssertionError: 'vafqv7gd' != '""'

----------------------------------------------------------------------
Ran 2 tests in 3.636s

FAILED (failures=1)

Noticed that the model name is 2ez0obdv but Info returns a model whose name is nz1e.

Packages:
  • rubygem-hammer_cli_foreman-0.0.12-1.el6.noarch
  • rubygem-hammer_cli-0.0.12-1.el6.noarch

Related issues 1 (0 open1 closed)

Related to Hammer CLI - Bug #3954: Info commands must always use IDs instead of names in api callsClosedTomáš Strachota01/07/2014Actions
Actions

Also available in: Atom PDF