client/rhel/rhn-client-tools/src/up2date_client/gui.py | 40 -----------
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 18 +++-
2 files changed, 15 insertions(+), 43 deletions(-)
New commits:
commit 3b4f527fcda8eb600c977cd877b6f0241dbb5aa2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 09:59:21 2010 +0200
Instead of the ActivateSubscriptionPage and activateSubscriptionShouldBeShown, we
should try to activate the hardware in chooseChannelShouldBeShown.
If the hardware asset code does not get activated, nothing bad really
happens.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
index a931f92..4b0ce37 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -36,7 +36,6 @@ import rhnregGui
class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
- rhnregGui.ActivateSubscriptionPage,
rhnregGui.ReviewSubscriptionPage, rhnregGui.CreateProfilePage,
rhnregGui.ProvideCertificatePage, rhnregGui.FinishPage,
rhnregGui.ChooseChannelPage):
@@ -54,9 +53,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
"onChooseServerPageNext" : self.onChooseServerPageNext,
"onLoginPagePrepare" : self.onLoginPagePrepare,
"onLoginPageNext" : self.onLoginPageNext,
- "onActivateSubscriptionPagePrepare" :
self.onActivateSubscriptionPagePrepare,
- "onActivateSubscriptionPageBack" :
self.onActivateSubscriptionPageBack,
- "onActivateSubscriptionPageNext" :
self.onActivateSubscriptionPageNext,
"onChooseChannelPageNext" : self.onChooseChannelPageNext,
"onChooseChannelPageBack" : self.onChooseChannelPageBack,
"onChooseChannelPagePrepare" : self.onChooseChannelPagePrepare,
@@ -75,7 +71,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
rhnregGui.StartPage.__init__(self)
rhnregGui.ChooseServerPage.__init__(self)
rhnregGui.LoginPage.__init__(self)
- rhnregGui.ActivateSubscriptionPage.__init__(self)
rhnregGui.ChooseChannelPage.__init__(self)
rhnregGui.CreateProfilePage.__init__(self)
rhnregGui.ReviewSubscriptionPage.__init__(self)
@@ -92,9 +87,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
contents = self.loginPageVbox()
container = self.xml.get_widget("loginPageVbox")
container.pack_start(contents, True)
- contents = self.activateSubscriptionPageVbox()
- container = self.xml.get_widget("linkToSubscriptionPageVbox")
- container.pack_start(contents, True)
contents = self.chooseChannelPageVbox()
container = self.xml.get_widget("chooseChannelPageVbox")
container.pack_start(contents, True)
@@ -114,7 +106,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
self.initProfile = False
self.oemInfo = {}
self.productInfo = {}
- self.showedActivateSubscriptionPage = False
self.already_registered_already_shown = False
self.druid = self.xml.get_widget("druid")
@@ -127,8 +118,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
self.startPage = self.xml.get_widget("startPage")
self.chooseServerPage = self.xml.get_widget("chooseServerPage")
self.provideCertificatePage =
self.xml.get_widget("provideCertificatePage")
- self.activateSubscriptionPage = \
-
self.xml.get_widget("activateSubscriptionPage")
self.loginPage = self.xml.get_widget("loginPage")
self.chooseChannelPage = self.xml.get_widget("chooseChannelPage")
self.createProfilePage = self.xml.get_widget("createProfilePage")
@@ -236,39 +225,14 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage,
rhnregGui.LoginPage,
"""This function is used by the create new account dialog so it
doesn't
need to have any knowledge of the screen mechanism or order.
"""
- self.showedActivateSubscriptionPage = False
- if rhnregGui.activateSubscriptionShouldBeShown():
- self.druid.set_page(self.activateSubscriptionPage)
- elif rhnregGui.chooseChannelShouldBeShown():
+ if rhnregGui.chooseChannelShouldBeShown():
self.druid.set_page(self.chooseChannelPage)
else:
self.druid.set_page(self.createProfilePage)
- def onActivateSubscriptionPagePrepare(self, page, dummy):
- self.showedActivateSubscriptionPage = True
- self.activateSubscriptionPagePrepare()
-
- def onActivateSubscriptionPageBack(self, page, dummy):
- self.druid.set_page(self.loginPage)
- return True
-
- def onActivateSubscriptionPageNext(self, page, dummy):
- status = self.activateSubscriptionPageVerify()
- if rhnregGui.chooseChannelShouldBeShown():
- self.druid.set_page(self.chooseChannelPage)
- if status is True:
- return True
- status = self.activateSubscriptionPageApply()
- if status is True:
- return True
-
def onChooseChannelPageBack(self, page, dummy):
- if self.showedActivateSubscriptionPage == True:
- self.druid.set_page(self.activateSubscriptionPage)
- else:
- self.druid.set_page(self.loginPage)
-
+ self.druid.set_page(self.loginPage)
return True
def onChooseChannelPageNext(self, page, dummy):
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 6fcbef7..beb15d2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -73,7 +73,7 @@ email = ""
organization = None
newAccount = None # Should be assigned True or False
productInfo = None
-regNum = None
+hw_activation_code = None
serverType = None
chosen_channel = None
@@ -694,8 +694,16 @@ def chooseChannelShouldBeShown():
Returns True if the choose channel window should be shown, else
returns False.
'''
+ global hw_activation_code
- # First and foremost, does the server support eus?
+ # First and foremost, we should try to activate hardware
+ if serverType == 'hosted':
+ # ... but only on hosted
+ setBusyCursor()
+ hw_activation_code = rhnreg._activate_hardware(username, password)
+ setArrowCursor()
+
+ # Second and foremost, does the server support eus?
if rhnreg.server_supports_eus():
global username, password
@@ -892,11 +900,11 @@ class CreateProfilePage:
pwin = progress.Progress()
pwin.setLabel(_("Sending your profile information to Red Hat Network.
Please wait."))
self.systemId = None
- global newAccount, email, username, password, regNum, \
+ global newAccount, email, username, password, hw_activation_code, \
_hasBaseChannelAndUpdates, chosen_channel
other = {}
- if regNum:
- other['registration_number'] = regNum
+ if hw_activation_code:
+ other['registration_number'] = hw_activation_code
if chosen_channel is not None:
other['channel'] = chosen_channel