| Summary: | "Software Channels" page should show available flex guest entitlements for channels if system Flex Guest | ||
|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Xixi <xdmoon> |
| Component: | WebUI | Assignee: | Milan Zázrivec <mzazrivec> |
| Status: | CLOSED ERRATA | QA Contact: | Martin Minar <mminar> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 530 | CC: | cperry, jhutar, mkoci, mminar, mzazrivec, tlestach, xdmoon |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | spacewalk-java-1.2.39-70 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-06-17 02:34:38 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 677501 | ||
|
Description
Xixi
2011-01-28 01:58:12 UTC
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 |