client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 6 +
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 76 --------------
2 files changed, 11 insertions(+), 71 deletions(-)
New commits:
commit 03d736e46c0f1809e3ac497c3b08407afbacddab
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 24 12:06:28 2010 +0100
Do not send org_id in TUI as it never gets initialized.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index b877f26..d6ae2d6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -1146,13 +1146,7 @@ class Tui:
if hardwareInfo is not None:
try:
- # Only send up org_id if it exists.
- if self.other.has_key('org_id'):
- activateHWResult = rhnreg.activateHardwareInfo(
- self.userName, self.password,
- hardwareInfo, self.other['org_id'])
- else:
- activateHWResult = rhnreg.activateHardwareInfo(
+ activateHWResult = rhnreg.activateHardwareInfo(
self.userName, self.password,
hardwareInfo)
if activateHWResult.getStatus() == \
commit 7b812c9d0d8bbbaa2e0d1377eaec3b485e761362
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Mar 29 16:31:03 2010 +0200
_activate_IN_on_disk not longer used, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index fd65d7a..b877f26 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -1132,31 +1132,6 @@ class Tui:
self.saw_sub_window = 0
- def _activate_IN_on_disk(self, inst_num):
- # Activate the #
- # Only send up org_id if it exists.
- try:
- if self.other.has_key('org_id'):
- self.activate_result = \
- rhnreg.activateRegistrationNumber(
- self.userName, self.password,
- inst_num,
- self.other['org_id'])
- else:
- self.activate_result = \
- rhnreg.activateRegistrationNumber(
- self.userName, self.password,
- inst_num)
-
- if self.activate_result.getStatus() == \
- rhnreg.ActivationResult.ACTIVATED_NOW:
- self.activated_now = 1
-
- except up2dateErrors.InvalidRegistrationNumberError:
- self.invalid_num_on_disk = 1
- except up2dateErrors.NotEntitlingError:
- self.non_entitling_num_on_disk = 1
-
def _activate_hardware(self):
# Read the asset code from the hardware.
commit fbdbd3f75318f173dd2cf4dc7f2b11a302af055d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Mar 29 16:22:57 2010 +0200
Use /etc/sysconfig/rhn/hw-activation-code for the hardware activation code.
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 8743536..e6b92f8 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -41,6 +41,8 @@ REMIND_FILE = "%s/rhn_register_remind" % SYSID_DIR
# REG_NUM_FILE is the new rhel 5 number.
REG_NUM_FILE = "%s/install-num" % SYSID_DIR
+HW_CODE_FILE = "%s/hw-activation-code" % SYSID_DIR
+
import config
cfg = config.initUp2dateConfig()
log = up2dateLog.initLog()
@@ -134,6 +136,10 @@ def writeSystemId(systemId):
return res
+def writeHWCode(hw_activation_code):
+ """Returns True if the write is successful or False if it
fails."""
+ return _write_secure_file(HW_CODE_FILE, hw_activation_code + '\n')
+
def writeRegNum(regNum):
"""Returns True if the write is successful or False if it
fails."""
file_contents = regNum + '\n'
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index 41b4302..fd65d7a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -1184,7 +1184,7 @@ class Tui:
rhnreg.ActivationResult.ACTIVATED_NOW:
self.other['registration_number'] = \
activateHWResult.getRegistrationNumber()
- rhnreg.writeRegNum(self.other['registration_number'])
+ rhnreg.writeHWCode(self.other['registration_number'])
self.activated_now = 1
except up2dateErrors.NotEntitlingError:
log.log_debug('There are are no entitlements associated '
commit 38a4cddb9e48e2609c0cc329bbdc2049cb2aeae2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Mar 29 16:18:02 2010 +0200
Run the hardware activation which used to be in the _show_subscription_window.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index f5f340e..41b4302 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -777,6 +777,9 @@ class FinishWindow:
reg_info = None
try:
+ if self.tui.serverType == 'hosted':
+ self.tui._activate_hardware()
+
# reg_info dict contains: 'system_id', 'channels',
# 'failed_channels', 'slots', 'failed_slots'
log.log_debug('other is %s' % str(self.tui.other))
@@ -1189,44 +1192,6 @@ class Tui:
except up2dateErrors.InvalidRegistrationNumberError:
log.log_debug('The hardware id was not recognized as valid.')
- def _show_subscription_window(self):
-
- if self.serverType == 'hosted':
- self._activate_hardware()
-
- # Read the IN # off disk.
- self.read_reg_num = rhnreg.readRegNum()
- if self.read_reg_num != None and len(self.read_reg_num) > 0:
- if self.serverType == 'hosted':
- self._activate_IN_on_disk(self.read_reg_num)
- else:
- self.non_entitling_num_on_disk = 1
- # Save the read reg num as the installation number for this
- # registration.
- self.other['registration_number'] = self.read_reg_num
-
- log.log_debug('server type is %s' % self.serverType)
-
- # Don't show the subscription window if we have
- # subscriptions available.
- try:
- subs = rhnreg.getRemainingSubscriptions(self.userName,
- self.password)
- except up2dateErrors.NoBaseChannelError, e:
- subs = 0
-
- log.log_debug('subs is %s' % subs)
-
- # -1 is infinite
- if int(subs) != 0:
- log.log_debug('we still have subscriptions %s' % str(subs))
-
- # bz442930 : Should allow registration when login and password is changed
- return False
- else:
- return True
-
-
def run(self):
log.log_debug("Running %s" % self.__class__.__name__)
self.initResults()
Show replies by date