Bug 1321053

Summary: hammer host-collection info fails if --name is used
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: HammerAssignee: Andrew Kofink <akofink>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-02 13:59:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Og Maciel 2016-03-24 14:41:09 UTC
Description of problem:

You cannot get the info for a host collection through hammer by name, only by id

hammer> host-collection list --organization-id 1
---|---------------|-------|------------
ID | NAME          | LIMIT | DESCRIPTION
---|---------------|-------|------------
5  | test123       | None  |
1  | RHEL 7 Server | None  |
2  | RHEL 6 Server | None  |
3  | RHEL 5 Server | None  |
4  | Capsule       | None  |
---|---------------|-------|------------

Note that you cannot get the info by name, only by ID

hammer> host-collection info --id 5
ID:          5
Name:        test123
Limit:       None
Description:
Total Hosts: 0

hammer> host-collection info --name test123
undefined method `id' for nil:NilClass

Version-Release number of selected component (if applicable):

* Satellite 6.2.0 SNAP 5.1

How reproducible:


Steps to Reproduce:
1. Create a host-collection
2. use hammer host-collection --name <name of your new host collection>
3.

Actual results:

undefined method `id' for nil:NilClass



Expected results:

Additional info:

Discovered while testing https://bugzilla.redhat.com/show_bug.cgi?id=1214675

Comment 2 Brad Buckingham 2016-04-13 16:35:25 UTC
This is very similar to bug 1324848.  They may be related to the same issue.

Comment 3 Andrew Kofink 2016-05-02 13:59:15 UTC

*** This bug has been marked as a duplicate of bug 1331875 ***