Bug 663455
|
Description
Devan Goodwin
2010-12-15 20:42:30 UTC
So the rule blocking this is:
if (consumer.hasEntitlement(product) && product.getAttribute("multi-entitlement") != "yes") {
pre.addError("rulefailed.consumer.already.has.product");
}
Which obviously will block any attempt to grab a future dated entitlement to keep you compliant with something you already have, if the product is exactly the same.
I would like to avoid a situation where we start playing with date checking if possible, as the subscriptions will probably often overlap, which means we likely need to figure out how much overlap counts as an attempt to multi-entitle.
I propose we change this rule to instead, check if the consumer has an entitlement from the *exact* pool being requested. In essence we block multiple entitlements from one subscription, rather than any subscription for that product ID.
The downside to this would be allowing a customer who had two subscriptions to the same product with similar dates to consume an entitlement from each. As far as I know this won't harm anything, and the tools should prevent them from accidentally doing this unless they explicitly want to do so. In that light it seems like the easiest way to allow future entitling, and would allow us to avoid trying to make sense of the dates and what counts as overlap.
Thoughts?
Above proposal was agreed upon. Fixed in candlepin.git master: 57e9ce3a1a7a351a9127d37d3bb31cd82803353b BETA branch: dd1848ab8abec5c8d07bf2bf5f1b43d5d4d394ac Verifying Version... [root@jsefler-onprem01 ~]# rpm -qa | grep subscription-manager subscription-manager-firstboot-0.93.14-1.git.9.304e707.el6.x86_64 subscription-manager-0.93.14-1.git.9.304e707.el6.x86_64 subscription-manager-gnome-0.93.14-1.git.9.304e707.el6.x86_64 To verify this bug, I will use an on-premises candlepin with the cp_product_utils imported to provide the following product with overlapping dates: ProductName: Smart Management Add On ContractNumber: 45 Begins: 2011-01-24 Expires: 2012-01-24 ProductName: Smart Management Add On ContractNumber: 46 Begins: 2011-01-24 Expires: 2012-01-24 ProductName: Smart Management Add On ContractNumber: 47 Begins: 2012-01-14 Expires: 2013-01-13 Using the GUI, I can now "triple" subscribe to all pools that provide the same product. See attached screen shot. And, if I go to the command line and try to individually subscribe to the pools again, I will get blocked as expected. [root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812dbb8d4d012dbb8ef8000212 This consumer is already subscribed to the product matching pool with id 'ff8080812dbb8d4d012dbb8ef8000212' [root@jsefler-onprem01 ~]# subscription-manager subscribe --pool=ff8080812dbb8d4d012dbb8ef8190214 This consumer is already subscribed to the product matching pool with id 'ff8080812dbb8d4d012dbb8ef8190214' Note: It's no so easy to attempt to subscribe to the pool whose dates are valid in the future because the the cli tool currently excludes subscriptions in list --all --available that are not valid today/now. I'll assume that if I knew its pool, I would also get blocked by an attempt to subscribe to it too. Created attachment 475228 [details]
demonstrates that I can be "triple" subscribed to the same product without getting blocked by a "you are already subscribed to this product" dialog.
Using the Compliance assistant and generated product certs copied from the onpremises candlepin server (proxy/generated_certs to /etc/pki/product), I am also able to "Become Compliant" to product "RHEL for Workstations SVC" with a RHEL Workstation" subscription that is available today, AND I am also able to use "Become Compliant" to subscribe to another contract that starts in the future. See the next two attached screenshots. Created attachment 475229 [details]
shows compliance of "RHEL for Workstations SVC" after using "Become Compliant" to subscribe to a two pools valid today and in the future.
Created attachment 475230 [details]
shows both the current and future subscriptions I used in the compliance tool that overlap the compliance of "RHEL for Workstations SVC"
moving to VERIFIED |