From 317e45866da4be68fbc01cd241cf50369f1d4cf6 Mon Sep 17 00:00:00 2001 From: synkd Date: Thu, 1 Sep 2022 14:31:59 -0400 Subject: [PATCH] Allow adding entitlements from unlimited pools 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. --- manifester/manifester.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifester/manifester.py b/manifester/manifester.py index de0da7a..d6894c5 100644 --- a/manifester/manifester.py +++ b/manifester/manifester.py @@ -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."