Bug 1559302

Summary: Not able to attach a subscription to a host with hammer
Product: Red Hat Satellite Reporter: Anand Agrawal <aagrawal>
Component: APIAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Jitendra Yejare <jyejare>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: akarsale, apatel, mhulan, tstrachota
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-22 09:03:42 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:
Embargoed:

Description Anand Agrawal 2018-03-22 08:56:52 UTC
Description

~~
hammer host subscription --attach --subscription-id $id --quantity 1
~~

While attaching subscription to host via above hammer command, it fails with below error message
~~
Failed to attach subscriptions to the host:
Task a5c8d982-3c25-4d21-b8e9-0ba3feae435d: ArgumentError: comparison of String with 0 failed
~~

Same thing happens, with API when quantity is passed as "1"



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


How reproducible:
Always, when quantity is passed via hammer

Steps to Reproduce:
1. hammer host subscription --attach --subscription-id $id --quantity 1

Actual results:
Failed to attach subscriptions to the host:
Task a5c8d982-3c25-4d21-b8e9-0ba3feae435d: ArgumentError: comparison of String with 0 failed

Expected results:
Subscription should be attached successfully.

Additional info:

If quantity is not passed, by default it takes quantity as 1 and this works.

Comment 1 Anand Agrawal 2018-03-22 09:03:42 UTC

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