Hide Forgot
Description of problem: System Details -> Software -> Software Channels page (rhn/systems/details/SystemChannels.do) shows only available regular entitlements for the channels tree, even if the system is a flex guest. It should show both regular and flex guest entitlements. Version-Release number of selected component (if applicable): Red Hat Network (RHN) Satellite 5.4.0 How reproducible: Always. Steps to Reproduce: 1. Have 5.4 satellite with both regular and flex guest entitlements. 2. Subscribe a KVM guest (running on an unsubscribed RHEL host) to rhel-x86_64-server-5. 3. Verify that it consumes a flex guest entitlement for the base channel's channel family. 4. Overview > Subscription Management > Software Channel Entitlements shows the RHN tools child channel has 1 regular entitlement available and 100 flex entitlements available: "Channel Entitlement: Red Hat Network Tools for Red Hat Enterprise Linux Regular Consumed: 1 Regular Available: 1 Consumed Flex Guests: 0 Available Flex Guests: 100 Systems Subscribed: 1" 5.Go to the system profile's Software > Software Channels tab, and see that the number of available "regular" entitlements is displayed for the system, even though it should be able to consume flex guest entitlements: "Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64) (1 available)" 6.Subscribe the system to this child channel, and note that the # available stays at 1 "Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64) (1 available)" and that the Software Channel Entitlements page shows that a flex guest entitlement has been consumed: "Channel Entitlement: Red Hat Network Tools for Red Hat Enterprise Linux Regular Consumed: 1 Regular Available: 1 Consumed Flex Guests: 1 Available Flex Guests: 99 Systems Subscribed: 2" Actual results: # of available regular entitlement is shown even for flex guest system Expected results: Both regular and flex guest entitlement shown for flex guest system Additional info:
This is due to SystemChannelsAction calling ChannelManager.getAvailableEntitlements() which only returns regular entitlements. src/com/redhat/rhn/frontend/action/systems/sdc/SystemChannelsAction.java ... // Setup request attributes request.setAttribute(RequestContext.SYSTEM, s); if (s.getBaseChannel() != null) { Channel baseChannel = s.getBaseChannel(); List channels = baseChannel.getAccessibleChildrenFor(user); Collections.sort(channels, new DynamicComparator("name", RequestContext.SORT_ASC)); ChildChannelDto[] childchannels = new ChildChannelDto[channels.size()]; for (int i = 0; i < channels.size(); i++) { Channel child = (Channel) channels.get(i); childchannels[i] = new ChildChannelDto(child.getId(), child.getName(), s.isSubscribed(child), ChannelManager.isChannelFreeForSubscription(s, child), child.isSubscribable(user.getOrg(), s)); childchannels[i].setAvailableSubscriptions( ChannelManager.getAvailableEntitlements(user.getOrg(), child)); } request.setAttribute(AVAIL_CHILD_CHANNELS, childchannels); form.set(NEW_BASE_CHANNEL_ID, s.getBaseChannel().getId()); if (log.isDebugEnabled()) { log.debug("base_channel: " + form.get(NEW_BASE_CHANNEL_ID)); } ... src/com/redhat/rhn/manager/channel/ChannelManager.java ... public static Long getAvailableEntitlements(Org org, Channel c) { ChannelEntitlementCounter counter = (ChannelEntitlementCounter) MethodUtil.getClassFromConfig( ChannelEntitlementCounter.class.getName()); Long retval = counter.getAvailableEntitlements(org, c); log.debug("getAvailableEntitlements: " + c.getLabel() + " got: " + retval); return retval; } ...
Workaround is to go to Software Subscriptions page to view the # of regular and flex entitlements for that channel.
bug 683539 also contains this same, plus a few more changes I'd like to see.
I fixed part of the problem described here in bug #673394 already, although the results do not exactly match what is requested here. In the alter channel subscription page, my fix shows number of available flex guest entitlements in applicable scenarios and number of regular entitlements if flex is zero or the system in question cannot consume flex. This means that it's not exactly clear which entitlement poll (flex vs. regular) the number shown is representing.
Alter channel subscriptions: display flex consumption in applicable scenarios. spacewalk.git: 30f6fe90f434d41d888283166205016b835da4f5 satellite.git SATELLITE-5.4: 97ea4b3cd8d3422299169c103203692230fb162c
One more modification required -- correct the entitlement count for custom channels: spacewalk.git master: 32b333cb2021979f55b0796502e1aa6ac0e21245 satellite.git SATELLITE-5.4: 44cda4947813700c261e00bbf968979477cca5cc
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. https://rhn.redhat.com/errata/RHSA-2011-0879.html