Skip to content

Commit

Permalink
Allow adding entitlements from unlimited pools
Browse files Browse the repository at this point in the history
The `rhsatqe` RHSM account contains a pool of Red Hat Beta Access
subscriptions with an unlimited quantity. Because this quantity is
represented as `-1` in the response to an API request for the details of
that pool, Manifester previously failed to add subscriptions from that
pool to the allocations it was creating. This PR enables Manifester to
pull entitlements from subscription pools that contain an unlimited
quantity of entitlements.
  • Loading branch information
synkd committed Sep 1, 2022
1 parent 62ff557 commit 317e458
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def process_subscription_pools(self, subscription_pools, subscription_data):
f"The following pools are matches for this subscription: {matching}"
)
for match in matching:
if match["entitlementsAvailable"] > subscription_data["quantity"]:
if (match["entitlementsAvailable"] > subscription_data["quantity"] or
match["entitlementsAvailable"] == -1):
logger.debug(
f"Pool {match['id']} is a match for this subscription and has "
f"{match['entitlementsAvailable']} entitlements available."
Expand Down

0 comments on commit 317e458

Please sign in to comment.