Bug 1154619

Summary: It's not possible to add a subscription on an activation key
Product: Red Hat Satellite Reporter: Elyézer Rezende <erezende>
Component: HammerAssignee: Christine Fouant <cfouant>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: aathomas, bbuckingham, erezende, jcallaha, tomckay
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/8549
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 05:18:19 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 Elyézer Rezende 2014-10-20 10:43:50 UTC
Description of problem:
When adding a subscription to an activation key hammer fails with an exception:

[ERROR 2014-10-19 02:29:49 Exception] Katello::Resources::Candlepin::ActivationKey: 400 Bad Request {"displayMessage":"Error: Only pools with multi-entitlement product subscriptions can be added to the activation key with a quantity greater than one.","requestUuid":"d8ffd582-34f2-4de6-a9c2-400c8eb53f47"} (POST /candlepin/activation_keys/ff8080814927128501492718cdcf044a/pools/ff8080814927128501492716f89103c6?quantity=10)

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


How reproducible:
Aways


Steps to Reproduce:
1. hammer subscription list --organization-id='<id>'
2. activation-key add-subscription --subscription-id='<subid>' --id='<id>' --quantity='10' # where quantity is the available quantity

Actual results:
An exception is raised and the subscription is not added to the activation key.

Expected results:
No exception raised and the subscription is added to the activation key.

Additional info:

Comment 3 Tom McKay 2014-10-20 12:47:09 UTC
The bug here is that the error message is not nicely formatted, correct Elyézer? The behavior itself is correct: Multiple of a single non-stackable subscription cannot be added to the same activation key.

Comment 4 Elyézer Rezende 2014-10-20 12:55:57 UTC
Yes, please provide a nicely formatted error message. I was not aware of what quantity should be used, and with a better error message this should not happen.

Comment 5 Christine Fouant 2014-12-02 21:06:13 UTC
Created redmine issue http://projects.theforeman.org/issues/8549 from this bug

Comment 6 Bryan Kearney 2014-12-09 15:04:41 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/8549 has been closed
-------------
Christine Fouant
Applied in changeset commit:katello|36cdaf21cfaf3b45d5af39089b67704ed79ce8ec.

Comment 9 jcallaha 2015-02-13 18:34:53 UTC
Verified.

Version Tested:
Satellite-6.1.0-RHEL-6-20150210.0
Satellite-6.1.0-RHEL-7-20150210.0

Comment 10 Bryan Kearney 2015-08-11 13:30:14 UTC
This bug is slated to be released with Satellite 6.1.

Comment 11 errata-xmlrpc 2015-08-12 05:18:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592