client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 20 ++++-------
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 11 ------
2 files changed, 9 insertions(+), 22 deletions(-)
New commits:
commit 0400c85929cfc92b2de5eb93c77be9b5a6a67c47
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 12 14:21:15 2010 +0100
The getAvailableSubscriptions is never called with useCache True, removing the caching
code and caching-only invocation.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index 53e6368..a4d0b2c 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -43,7 +43,6 @@ REMIND_FILE = "%s/rhn_register_remind" % SYSID_DIR
REG_NUM_FILE = "%s/install-num" % SYSID_DIR
cachedOrgs = None
-cachedAvailableSubscriptions = None
import config
cfg = config.initUp2dateConfig()
@@ -564,7 +563,7 @@ def getRemainingSubscriptions(username, password):
log.log_debug('Server returned %s' % subs)
return subs
-def getAvailableSubscriptions(username, password, useCache=False):
+def getAvailableSubscriptions(username, password):
"""Higher level and more convenient version of
getRemainingSubscriptions.
Precondition: getCaps() was called.
@@ -577,7 +576,7 @@ def getAvailableSubscriptions(username, password, useCache=False):
probably others
"""
- global cachedAvailableSubscriptions
+ availableSubscriptions = None
log.log_debug('Calling getAvailableSubscriptions')
@@ -586,16 +585,15 @@ def getAvailableSubscriptions(username, password, useCache=False):
"registration.remaining_subscriptions call which is needed."
raise up2dateErrors.ServerCapabilityError(message)
- if cachedAvailableSubscriptions is None or useCache is False:
- try:
- cachedAvailableSubscriptions = \
+ try:
+ availableSubscriptions = \
getRemainingSubscriptions(username, password)
- except up2dateErrors.NoBaseChannelError, e:
- cachedAvailableSubscriptions = 0
- log.log_debug('NoBaseChannelError raised.')
+ except up2dateErrors.NoBaseChannelError, e:
+ availableSubscriptions = 0
+ log.log_debug('NoBaseChannelError raised.')
log.log_debug('Returning %s available subscriptions.' %
- cachedAvailableSubscriptions)
- return cachedAvailableSubscriptions
+ availableSubscriptions)
+ return availableSubscriptions
def sendHardware(systemId, hardwareList):
s = rhnserver.RhnServer()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index e77ec5f..710e511 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -1705,9 +1705,6 @@ def autoActivateNumbersOnce():
there was an error. If this call is made more than once, every call after
the first will return (None, None).
- After activating the numbers, it will refresh the cached available
- subscriptions used by rhnreg.getAvailableSubscriptions.
-
If something is activated, the resulting reg num will be stored so it will
be used when creating the system profile (for child channels). A number
from disk takes precedence over hardware info if both are activated.
@@ -1776,14 +1773,6 @@ def autoActivateNumbersOnce():
else:
regNum = registrationNumber
- # Call getAvailableSubscriptions to refresh its cache
- rhnreg.getAvailableSubscriptions(username, password)
- ## log.log_me("It looks like the EN was successfully
activated"
- ## " but there still aren't any available "
- ## "entitlements in the account. Maybe there's a
"
- ## "delay with them activating, so we'll continue
"
- ## "with registration and hope they show up later
"
- ## "and apply to this profile.")
return (activateRegNumResult, activateHWResult)
Show replies by date