client/rhel rel-eng/packages
by Jan Pazdziora
client/rhel/rhn-client-tools/rhn-client-tools.spec | 6 +++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 4655b5e33c17ba70d20fc4296ad14c2c53225c77
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 13:29:23 2010 +0200
Automatic commit of package [rhn-client-tools] release [0.9.12-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index a238a0d..9fbf69e 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 0.9.11
+Version: 0.9.12
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -238,6 +238,10 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
+* Fri Apr 02 2010 Jan Pazdziora 0.9.12-1
+- Code cleanup.
+- Remove the installation number support in GUI.
+
* Wed Mar 31 2010 Jan Pazdziora 0.9.11-1
- Make sure activate_hardware_info is called before available_eus_channels.
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index a8ce3c7..cf52c34 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-0.9.11-1 client/rhel/rhn-client-tools/
+0.9.12-1 client/rhel/rhn-client-tools/
14 years, 1 month
3 commits - client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/data/gui.glade | 90 -----------------
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 36 ------
2 files changed, 1 insertion(+), 125 deletions(-)
New commits:
commit 3a44c5f77a2583419068900ba29218cfa7bd6dee
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 16:13:07 2010 +0200
Specify the mainWin title directly in the .glade file.
diff --git a/client/rhel/rhn-client-tools/data/gui.glade b/client/rhel/rhn-client-tools/data/gui.glade
index 0c8532a..cf2cacc 100644
--- a/client/rhel/rhn-client-tools/data/gui.glade
+++ b/client/rhel/rhn-client-tools/data/gui.glade
@@ -6,7 +6,7 @@
<widget class="GtkWindow" id="mainWin">
<property name="visible">True</property>
- <property name="title" translatable="yes">Setting up software updates</property>
+ <property name="title" translatable="yes">Registering for software updates</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="modal">False</property>
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 4136e93..93df983 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -168,7 +168,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
def onStartPagePrepare(self, page, dummy, manualPrepare=False):
if not manualPrepare:
self.startPage.emit_stop_by_name("prepare")
- self.mainWin.set_title(_("Registering for software updates"))
self.druid.set_buttons_sensitive(False, True, True, False)
if rhnreg.registered() and not self.already_registered_already_shown:
# Dialog constructor returns when dialog closes
@@ -183,7 +182,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
def onChooseServerPagePrepare(self, page, dummy):
self.chooseServerPage.emit_stop_by_name("prepare")
- self.mainWin.set_title(_("Registering for software updates"))
self.chooseServerPagePrepare()
def onChooseServerPageNext(self, page, dummy):
commit af872e629b5491cbc5f350855fbf0e6d14ac7f3f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 13:49:10 2010 +0200
Remove the regFinishPage widget as well.
diff --git a/client/rhel/rhn-client-tools/data/gui.glade b/client/rhel/rhn-client-tools/data/gui.glade
index 93608b1..0c8532a 100644
--- a/client/rhel/rhn-client-tools/data/gui.glade
+++ b/client/rhel/rhn-client-tools/data/gui.glade
@@ -172,94 +172,6 @@
</child>
<child>
- <widget class="GnomeDruidPageStandard" id="regFinishPage">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Registration information</property>
- <property name="logo">shadowman-round-48.png</property>
- <signal name="finish" handler="onRegFinishPageFinish"/>
- <signal name="prepare" handler="onRegFinishPagePrepare"/>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox56">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFrame" id="regFinishFrame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow17">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="regFinishTextView">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_NONE</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label59">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Important Registration Info</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
<widget class="GnomeDruidPageStandard" id="provideCertificatePage">
<property name="visible">True</property>
<property name="title" translatable="yes">Provide a security certificate</property>
commit 18a32a65559627a082d8fd3500bedfb0e92193d2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 12:00:56 2010 +0200
Remove onRegFinishPagePrepare and onFinishPageFinish which were commented out anyway.
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 b852914..4136e93 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -60,8 +60,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
"onCreateProfilePageNext" : self.onCreateProfilePageNext,
"onReviewSubscriptionPagePrepare" : self.onReviewSubscriptionPagePrepare,
"onReviewSubscriptionPageNext" : self.onReviewSubscriptionPageNext,
-## "onRegFinishPagePrepare" : self.onRegFinishPagePrepare,
-## "onRegFinishPageFinish" : self.onFinishPageFinish,
"onProvideCertificatePageBack" : self.onProvideCertificatePageBack,
"onProvideCertificatePageNext" : self.onProvideCertificatePageNext,
"onFinishPagePrepare" : self.onFinishPagePrepare,
@@ -274,38 +272,6 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
return True
-## def onRegFinishPagePrepare(self, page, dummy):
-## # Disable the next button and enable the finish one
-## self.druid.set_buttons_sensitive(False, False, False, False)
-## self.druid.set_show_finish(True)
-## self.druid.finish.set_label (_("_Finish"))
-## self.xml.get_widget("regFinishPage").emit_stop_by_name("prepare")
-## self.xml.get_widget("mainWin").set_title(_("Finish registering for software updates"))
-## try:
-## ret = rhnreg.finishMessage(self.systemId)
-## except up2dateErrors.Error:
-## ret = (0, "", "")
-## (returnCode, titleText, messageText) = ret[:3]
-##
-## textArea = self.xml.get_widget("regFinishTextView")
-## page = self.xml.get_widget("regFinishPage")
-##
-## page.set_title(titleText)
-## # TODO These cases used to be different when this wasn't the end of the
-## # druid (I think only one changed the buttons). Figure out if we still
-## # need to do something different based on returnCode
-## if returnCode == 1:
-## buffer = gtk.TextBuffer(None)
-## buffer.set_text(messageText)
-## textArea.set_buffer(buffer)
-## if returnCode == -1:
-## buffer = gtk.TextBuffer(None)
-## buffer.set_text(messageText)
-## textArea.set_buffer(buffer)
-##
-## def onFinishPageFinish(self, page, dummy=None):
-## gtk.main_quit()
-
def onProvideCertificatePageBack(self, page=None, dummy=None):
self.druid.set_page(self.chooseServerPage)
return True
14 years, 1 month
10 commits - client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/data/gui.glade | 24
client/rhel/rhn-client-tools/rhn-client-tools.spec | 1
client/rhel/rhn-client-tools/src/firstboot/Makefile | 2
client/rhel/rhn-client-tools/src/firstboot/rhn_activate_gui.py | 75 --
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 2
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 76 --
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 299 ----------
7 files changed, 29 insertions(+), 450 deletions(-)
New commits:
commit 5efbb06f15a24281e2f940fd08542b4f7276c12a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 13:53:20 2010 +0200
Make sure activate_hardware_info is called before available_eus_channels.
The activate_hardware_info can actually give the account the
entitlements it would need to access z stream/eus.
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 4b0ce37..b852914 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -225,7 +225,7 @@ 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.
"""
- if rhnregGui.chooseChannelShouldBeShown():
+ if rhnregGui.ChooseChannelPage.chooseChannelShouldBeShown(self):
self.druid.set_page(self.chooseChannelPage)
else:
self.druid.set_page(self.createProfilePage)
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 17acf62..ceef399 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -524,30 +524,6 @@ class ConfirmAllUpdatesDialog:
self.dialog.destroy()
-def chooseChannelShouldBeShown():
- '''
- Returns True if the choose channel window should be shown, else
- returns False.
- '''
-
- # First and foremost, we should try to activate hardware
- try_to_activate_hardware()
-
- # Second and foremost, does the server support eus?
- if rhnreg.server_supports_eus():
-
- global username, password
-
- channels = rhnreg.getAvailableChannels(username, password)
-
- channels = channels['channels']
-
- if len(channels) > 0:
- return True
- else:
- return False
-
-
class ChooseChannelPage:
def __init__(self):
self.chooseChannelXml = gtk.glade.XML(gladefile,
@@ -570,7 +546,7 @@ class ChooseChannelPage:
global username, password
- self.eus_channels = rhnreg.getAvailableChannels(username, password)
+ # The self.eus_channels was populated in chooseChannelShouldBeShown
self.channels = self.eus_channels['channels']
self.receiving_updates = self.eus_channels['receiving_updates']
@@ -616,6 +592,28 @@ class ChooseChannelPage:
else:
self.chose_all_updates = True
+ def chooseChannelShouldBeShown(self):
+ '''
+ Returns True if the choose channel window should be shown, else
+ returns False.
+ '''
+
+ # First and foremost, we should try to activate hardware
+ try_to_activate_hardware()
+
+ # Second and foremost, does the server support eus?
+ if rhnreg.server_supports_eus():
+
+ global username, password
+
+ self.eus_channels = rhnreg.getAvailableChannels(username, password)
+
+ if len(self.eus_channels['channels']) > 0:
+ return True
+ else:
+ return False
+
+
class CreateProfilePage:
def __init__(self):
self.createProfileXml = gtk.glade.XML(gladefile,
commit 7339d0527911cf537d4359e73c40e3bce98a16a8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:16:03 2010 +0200
Widget activateSubscriptionPage no longer used, removing.
diff --git a/client/rhel/rhn-client-tools/data/gui.glade b/client/rhel/rhn-client-tools/data/gui.glade
index a69df88..93608b1 100644
--- a/client/rhel/rhn-client-tools/data/gui.glade
+++ b/client/rhel/rhn-client-tools/data/gui.glade
@@ -101,30 +101,6 @@
</child>
<child>
- <widget class="GnomeDruidPageStandard" id="activateSubscriptionPage">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Access a subscription</property>
- <property name="logo">shadowman-round-48.png</property>
- <signal name="next" handler="onActivateSubscriptionPageNext"/>
- <signal name="back" handler="onActivateSubscriptionPageBack"/>
- <signal name="prepare" handler="onActivateSubscriptionPagePrepare"/>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="linkToSubscriptionPageVbox">
- <property name="border_width">16</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
- </child>
-
- <child>
<widget class="GnomeDruidPageStandard" id="chooseChannelPage">
<property name="visible">True</property>
<property name="title" translatable="yes">Select operating system release</property>
commit dea799ecd47d1bea64d5b24ea972afb70a565d18
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:15:11 2010 +0200
Class ActivateSubscriptionPage no longer used, removing.
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 5b74628..17acf62 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -497,108 +497,6 @@ class LoginPage:
return False
-class ActivateSubscriptionPage:
- """The screen that allows activation a installation number.
-
- activateSubscriptionShouldBeShown() should be used to decide whether to show
- this page or not.
-
- """
- def __init__(self):
- self.activateSubscriptionNoneXml = gtk.glade.XML(gladefile,
- "activateSubscriptionNoneWindowVbox",
- domain="rhn-client-tools")
- self.activateSubscriptionNoneVbox = \
- self.activateSubscriptionNoneXml.get_widget(
- "activateSubscriptionNoneWindowVbox")
- self.registrationNumberEntry = \
- self.activateSubscriptionNoneXml.get_widget(
- "registrationNumberEntry")
- self.registrationNumberStatusLabel = \
- self.activateSubscriptionNoneXml.get_widget(
- "registrationNumberStatusLabel")
- self.registrationNumberEntry.connect("changed",
- self.activateSubscriptionPageRegistrationNumberChanged)
- self.activatedRegNums = []
-
- def activateSubscriptionPageVbox(self):
- return self.activateSubscriptionNoneVbox
-
- def activateSubscriptionPagePrepare(self):
- # We need to call this manually otherwise it won't say the number's been
- # activated when they click back from the create profile page until they
- # change it.
- self.activateSubscriptionPageRegistrationNumberChanged()
-
- def activateSubscriptionPageVerify(self):
- """Returns False if everything is ok. Returns True if there's a problem
- and the user was notified.
-
- """
- newRegNum = self.registrationNumberEntry.get_text()
- if newRegNum == "":
- errorWindow(_("You must enter an installation number."))
- self.registrationNumberEntry.grab_focus()
- return True
- return False
-
- def activateSubscriptionPageApply(self):
- """Returns False if everything is ok. Returns True if there's a problem
- and the user was notified.
-
- """
- status = callAndFilterExceptions(
- self._activateSubscriptionPageApply,
- [],
- _("There was an error activating your number.")
- )
- # Need to handle a filtering returning None
- if status is False:
- return False
- else:
- return True
-
- def _activateSubscriptionPageApply(self):
- """See comment for activateSubscriptionPageApply."""
- global username, password, organization, regNum
- regNum = self.registrationNumberEntry.get_text()
- if regNum not in self.activatedRegNums:
- try:
- setBusyCursor()
- result = rhnreg.activateRegistrationNumber(username, password,
- regNum, organization)
- except up2dateErrors.InvalidRegistrationNumberError:
- setArrowCursor()
- errorWindow(rhnreg_constants.INVALID_NUMBER % regNum)
- return True
- except up2dateErrors.NotEntitlingError:
- setArrowCursor()
- errorWindow(rhnreg_constants.NONENTITLING_NUMBER)
- return True
- setArrowCursor()
- if result.getStatus() == ActivationResult.ALREADY_USED:
- errorWindow(rhnreg_constants.ALREADY_USED_NUMBER)
- return True
- else:
- assert result.getStatus() == ActivationResult.ACTIVATED_NOW
- reviewLog.activatedRegistrationNumber(regNum, result)
- self.activatedRegNums.append(regNum)
- rhnreg.writeRegNum(regNum)
- else:
- log.debug_log("Skipping activation because this number has already "
- "been activated.")
- return False
-
- def activateSubscriptionPageRegistrationNumberChanged(self, entry=None):
- newRegNum = self.registrationNumberEntry.get_text()
- if newRegNum in self.activatedRegNums:
- status = _("This installation number has already been activated.")
- else:
- status = ""
- status = "<small><i>%s</i></small>" % status
- self.registrationNumberStatusLabel.set_label(status)
-
-
class ReviewSubscriptionPage:
def __init__(self):
self.reviewSubscriptionXml = gtk.glade.XML(gladefile,
commit 3fd61370860bcf272e519a0537297c26b5ce3386
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:14:04 2010 +0200
rhn_activate_gui no longer used, removing.
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 82a4e7e..a238a0d 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -214,7 +214,6 @@ make -f Makefile.rhn-client-tools test
# firstboot is smart enough now to skip these modules
# if the modules say to
-%{_datadir}/firstboot/modules/rhn_activate_gui.*
%{_datadir}/firstboot/modules/rhn_login_gui.*
%{_datadir}/firstboot/modules/rhn_register_firstboot_gui_window.*
%{_datadir}/firstboot/modules/rhn_start_gui.*
diff --git a/client/rhel/rhn-client-tools/src/firstboot/Makefile b/client/rhel/rhn-client-tools/src/firstboot/Makefile
index 0a9a461..bbd6365 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/Makefile
+++ b/client/rhel/rhn-client-tools/src/firstboot/Makefile
@@ -3,7 +3,7 @@
# $Id$
MODULES = rhn_login_gui \
- rhn_activate_gui rhn_register_firstboot_gui_window \
+ rhn_register_firstboot_gui_window \
rhn_start_gui rhn_choose_server_gui \
rhn_provide_certificate_gui rhn_create_profile_gui \
rhn_review_gui rhn_finish_gui
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_activate_gui.py b/client/rhel/rhn-client-tools/src/firstboot/rhn_activate_gui.py
deleted file mode 100644
index 13eec7c..0000000
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_activate_gui.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# rhn_register.py - GUI front end code for firstboot screen resolution
-#
-# Copyright 2003 Red Hat, Inc.
-# Copyright 2003 Brent Fox <bfox(a)redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-import gtk
-import gobject
-import sys
-import os
-import functions
-
-import gnome, gnome.ui
-from gtk import glade
-
-from rhn_register_firstboot_gui_window import RhnRegisterFirstbootGuiWindow
-sys.path.insert(0, "/usr/share/rhn/up2date_client/")
-sys.path.insert(1,"/usr/share/rhn")
-
-import rhnreg
-import rhnregGui
-import up2dateErrors
-import messageWindow
-
-import gettext
-_ = gettext.gettext
-
-gettext.textdomain("rhn-client-tools")
-gtk.glade.bindtextdomain("rhn-client-tools")
-
-
-class RhnActivateWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.ActivateSubscriptionPage):
- #You must specify a runPriority for the order in which you wish your module to run
- runPriority = 108.5
- moduleName = _("Access Subscription")
- windowTitle = moduleName
- shortMessage = _("Connect to Red Hat Network")
- needsparent = 1
- needsnetwork = 1
- noSidebar = True
-
- def __init__(self):
- RhnRegisterFirstbootGuiWindow.__init__(self)
- rhnregGui.ActivateSubscriptionPage.__init__(self)
- if rhnreg.registered():
- self.skipme = True
-
- def updatePage(self):
- self.activateSubscriptionPagePrepare()
-
- def _getVbox(self):
- return self.activateSubscriptionPageVbox()
-
- def apply(self, *args):
- """Returns None if the page shouldn't be advanced."""
- ret = self.activateSubscriptionPageVerify()
- if ret:
- return None
- return True
-
-childWindow = RhnActivateWindow
commit f4773009300f3ef6a7d515676c94a012fa1c1e49
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:11:42 2010 +0200
getRemainingSubscriptions no longer used, removing.
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 11613dc..3b0ab50 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -496,50 +496,6 @@ def sat_supports_virt_guest_registration():
return False
-def getRemainingSubscriptions(username, password):
-
- s = rhnserver.RhnServer()
- server_type = getServerType()
-
- # The only point of this function is to determine if we should show the
- # Activate a Subscription screen, which we never do in satellite.
- if server_type == 'satellite':
- return 1
-
- arch = up2dateUtils.getArch()
- #Intentionally swapping, release/version so it is more in tune
- #with the perspective of release/version used by RHN Hosted.
- #bz: 442694
- release = up2dateUtils.getVersion()
- version = up2dateUtils.getRelease()
-
- virt_uuid, virt_type = get_virt_info()
- if virt_uuid is not None:
- log.log_debug('Sending up virt_uuid: %s' % str(virt_uuid))
- else:
- virt_uuid = ""
-
- # If we've gotten this far, we're definitely looking at hosted.
- # Hosted will have to support the sending of the release, and optionally,
- # the virt_uuid.
-
- if cfg['supportsSMBIOS']:
- smbios = hardware.get_smbios()
- subs = s.registration.remaining_subscriptions(username, password,
- arch,
- release,
- virt_uuid,
- smbios)
- else:
- subs = s.registration.remaining_subscriptions(username, password,
- arch,
- release,
- virt_uuid)
-
-
- log.log_debug('Server returned %s' % subs)
- return subs
-
def sendHardware(systemId, hardwareList):
s = rhnserver.RhnServer()
s.registration.add_hw_profile(systemId, hardwareList)
commit 3b95478ec9aecaf349867705cf7f3fbcf672ef2b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:10:32 2010 +0200
autoActivatedRegistrationNumber and foundRegNumButCouldntActivate no longer used, removing.
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 a1f23a4..5b74628 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -113,23 +113,6 @@ class ReviewLog:
def getTextBuffer(self):
return self._text
- def foundRegNumButCouldntActivate(self):
- self.addBoldText(_("Notice"))
- self.addText(rhnreg_constants.INST_NUM_ON_DISK)
- self.addText('') # adds newline
-
- def autoActivatedRegistrationNumber(self, registrationNumber,
- activationResult):
- self.addBoldText(_("Automatic Subscription Activation"))
- text = rhnreg_constants.SUB_NUM % registrationNumber
- text = text + ' ' + rhnreg_constants.SUB_NUM_RESULT
- self.addText(text)
- for channel, quantity in activationResult.getChannelsActivated().items():
- self.addBulletedText("%s (%s)" % (channel, quantity))
- for service, quantity in activationResult.getSystemSlotsActivated().items():
- self.addBulletedText("%s (%s)" % (service, quantity))
- self.addText('') # adds newline
-
def autoActivatedHardwareInfo(self, activationResult):
self.addBoldText(_("Automatic Subscription Activation"))
text = rhnreg_constants.SUB_NUM % activationResult.getRegistrationNumber()
commit e195fc7aea3d5b642ee212fbdc224bc8d672a286
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:06:53 2010 +0200
getAvailableSubscriptions no longer used, removing.
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 0c9a4a6..11613dc 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -540,38 +540,6 @@ def getRemainingSubscriptions(username, password):
log.log_debug('Server returned %s' % subs)
return subs
-def getAvailableSubscriptions(username, password):
- """Higher level and more convenient version of getRemainingSubscriptions.
-
- Precondition: getCaps() was called.
-
- Returns: -1 for inifinite subscriptions.
-
- Raises:
- * up2dateErrors.ServerCapabilityError
- * up2dateErrors.ValidationError
- probably others
-
- """
- availableSubscriptions = None
-
- log.log_debug('Calling getAvailableSubscriptions')
-
- if cfg['supportsRemainingSubscriptions'] is None:
- message = "The server doesn't support the " \
- "registration.remaining_subscriptions call which is needed."
- raise up2dateErrors.ServerCapabilityError(message)
-
- try:
- availableSubscriptions = \
- getRemainingSubscriptions(username, password)
- except up2dateErrors.NoBaseChannelError, e:
- availableSubscriptions = 0
- log.log_debug('NoBaseChannelError raised.')
- log.log_debug('Returning %s available subscriptions.' %
- availableSubscriptions)
- return availableSubscriptions
-
def sendHardware(systemId, hardwareList):
s = rhnserver.RhnServer()
s.registration.add_hw_profile(systemId, hardwareList)
commit cb4b39f72d386014c85fb48602a9a70ae7125014
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:05:42 2010 +0200
autoActivateNumbersOnce no longer used, removing.
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 8fd2370..a1f23a4 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -1489,86 +1489,6 @@ def callAndFilterExceptions(function, allowedExceptions,
errorHandler(disallowedExceptionMessage,
(exceptionType, exception, stackTrace))
-def autoActivateNumbersOnce():
- """Activates the registration/installation number from disk and the hardware
- info from the bios.
-
- Returns two values. They will be ActivationResults for the registration
- number from disk and the hardware info respectively if the activations
- happened. Each value will be None if that activation didn't take place or
- there was an error. If this call is made more than once, every call after
- the first will return (None, None).
-
- 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.
-
- Can raise CommunicationError.
-
- """
- global _autoActivatedNumbers, regNum
- if _autoActivatedNumbers:
- return (None, None)
- _autoActivatedNumbers = True
-
- log.log_debug("Trying to automatically activate stuff.")
-
- activateHWResult = None
- if serverType == 'hosted':
- hardwareInfo = None
- try:
- hardwareInfo = hardware.get_hal_system_and_smbios()
- except:
- log.log_me("There was an error while reading the hardware info from "
- "the bios. Traceback:\n")
- log.log_exception(*sys.exc_info())
- if hardwareInfo:
- try:
- activateHWResult = rhnreg.activateHardwareInfo(username, password,
- hardwareInfo, organization)
- if activateHWResult.getStatus() == ActivationResult.ACTIVATED_NOW:
- reviewLog.autoActivatedHardwareInfo(activateHWResult)
- regNum = activateHWResult.getRegistrationNumber()
- rhnreg.writeRegNum(regNum)
- except up2dateErrors.NotEntitlingError:
- log.log_debug('There are are no entitlements associated with this '
- 'hardware.')
- except up2dateErrors.InvalidRegistrationNumberError:
- log.log_debug('The hardware id was not recognized as valid.')
-
- # Try number from file after hardware info so this takes precedence for the
- # one we use later.
- activateRegNumResult = None
- registrationNumber = None
- try:
- registrationNumber = rhnreg.readRegNum()
- except IOError, error:
- log.log_me("There was an error while reading the registration "
- "number from disk:\n%s" % error)
- if registrationNumber:
- if serverType == 'hosted':
- try:
- activateRegNumResult = rhnreg.activateRegistrationNumber(
- username, password, registrationNumber,
- organization)
- if activateRegNumResult.getStatus() == ActivationResult.ACTIVATED_NOW:
- reviewLog.autoActivatedRegistrationNumber(registrationNumber,
- activateRegNumResult)
- regNum = activateRegNumResult.getRegistrationNumber()
- rhnreg.writeRegNum(regNum)
- except up2dateErrors.NotEntitlingError:
- log.log_me("The installation number on disk is not entitling.")
- regNum = registrationNumber
- rhnreg.writeRegNum(regNum)
- except up2dateErrors.Error, error:
- log.log_me("There was an error while activating the installation "
- "number found on disk:\n%s" % error)
- reviewLog.foundRegNumButCouldntActivate()
- else:
- regNum = registrationNumber
-
- return (activateRegNumResult, activateHWResult)
-
def try_to_activate_hardware():
global hw_activation_code
if serverType == 'hosted':
commit 44f25e5d3e765691b684814bf4e60f94a8b28421
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:04:19 2010 +0200
activateSubscriptionShouldBeShown no longer used, removing.
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 a24db99..8fd2370 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -514,52 +514,6 @@ class LoginPage:
return False
-def activateSubscriptionShouldBeShown():
- """If we activate an EN from disk and/or hardware info (eg asset tag) and
- one of them provides an entitlement for the base channel the system needs
- OR they have at least one available entitlement of the type the system
- needs, then we skip the activation screen (return False).
-
- This is a loose function because it's difficult to use it in firstboot
- where we want to without a hack if it's in ActivateSubscriptionPage.
-
- """
- try:
- setBusyCursor()
-
- # We have to call autoActivateNumbersOnce for satellite b/c it reads
- # and stores the IN # on disk, which we need.
- registrationNumberStatus, oemNumberStatus = autoActivateNumbersOnce()
- # Go ahead and return False if we're satellite.
- if rhnreg.getServerType() == 'satellite':
- return False
-
- # We should only skip the screen based on available subs (not
- # autoactivation) if we pass through any time after the first. That's
- # implemented by autoActivateNumbersOnce returning None, None on any
- # call after the first.
- if registrationNumberStatus and \
- registrationNumberStatus.getStatus() == ActivationResult.ACTIVATED_NOW:# and \
- # TODO up2dateUtils.getOSRelease() in registrationNumberStatus[ActivationResult.RELEASE]:
- return False
- if oemNumberStatus and \
- oemNumberStatus.getStatus() == ActivationResult.ACTIVATED_NOW:# and \
- # TODO up2dateUtils.getOSRelease() in oemNumberStatus[ActivationResult.RELEASE]:
- return False
- availableSubs = rhnreg.getAvailableSubscriptions(username, password)
-
- # I use != instead of > because -1 == infinite
- if int(availableSubs) != 0:
- return False
- except up2dateErrors.Error:
- setArrowCursor()
- log.log_me("There was an error while trying to figure out if we should "
- "skip the activation screen, so we'll show it. Error info:")
- log.log_exception(*sys.exc_info())
- setArrowCursor()
- return True
-
-
class ActivateSubscriptionPage:
"""The screen that allows activation a installation number.
commit de32378225f256d3e5d4a65aab250946895e4681
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 11:30:00 2010 +0200
Set the global hw_activation_code properly.
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 eddc100..a24db99 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -694,7 +694,6 @@ def chooseChannelShouldBeShown():
Returns True if the choose channel window should be shown, else
returns False.
'''
- global hw_activation_code
# First and foremost, we should try to activate hardware
try_to_activate_hardware()
@@ -1617,10 +1616,13 @@ def autoActivateNumbersOnce():
return (activateRegNumResult, activateHWResult)
def try_to_activate_hardware():
+ global hw_activation_code
if serverType == 'hosted':
# hardware asset codes only make sense on hosted
setBusyCursor()
- hw_activation_code = rhnreg._activate_hardware(username, password)
+ code = rhnreg._activate_hardware(username, password)
+ if code != None:
+ hw_activation_code = code
setArrowCursor()
def hasBaseChannelAndUpdates():
14 years, 1 month
client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py | 10 ++++-----
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 12 ++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)
New commits:
commit e40d8bcd8ea08757acf2a880b18bc9164b23b4a2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 10:51:18 2010 +0200
Move away from activateSubscriptionShouldBeShown in GUI firstboot as well.
diff --git a/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py b/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
index 05c52c7..6fea3ab 100644
--- a/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
+++ b/client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py
@@ -112,11 +112,11 @@ class RhnLoginWindow(RhnRegisterFirstbootGuiWindow, rhnregGui.LoginPage):
self.parent.setPage("rhn_finish_gui")
if ret:
return None
-
- if rhnregGui.activateSubscriptionShouldBeShown():
- self.parent.setPage("rhn_activate_gui")
- else:
- self.parent.setPage('rhn_create_profile_gui')
+
+ # We should try to activate hardware, even if no EUS in firstboot
+ rhnregGui.try_to_activate_hardware()
+
+ self.parent.setPage('rhn_create_profile_gui')
return True
def goToPageAfterLogin(self):
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 beb15d2..eddc100 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -697,11 +697,7 @@ def chooseChannelShouldBeShown():
global hw_activation_code
# 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()
+ try_to_activate_hardware()
# Second and foremost, does the server support eus?
if rhnreg.server_supports_eus():
@@ -1620,6 +1616,12 @@ def autoActivateNumbersOnce():
return (activateRegNumResult, activateHWResult)
+def try_to_activate_hardware():
+ if serverType == 'hosted':
+ # hardware asset codes only make sense on hosted
+ setBusyCursor()
+ hw_activation_code = rhnreg._activate_hardware(username, password)
+ setArrowCursor()
def hasBaseChannelAndUpdates():
"""Returns a bool indicating whether the system has registered, subscribed
14 years, 1 month
client/rhel
by Jan Pazdziora
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
14 years, 1 month
client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 26 +++++++++++
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 32 +-------------
2 files changed, 29 insertions(+), 29 deletions(-)
New commits:
commit ba97a7db28b5717b7f3eceaa1dc963045e1e2365
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 2 09:36:38 2010 +0200
Move _activate_hardware to rhnreg, so that it can be used from GUI as well.
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 e6b92f8..0c9a4a6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -718,6 +718,32 @@ def activateRegistrationNumber(username, password, registrationNumber,
" an installation number." % statusCode
raise up2dateErrors.CommunicationError(message)
+def _activate_hardware(login, password):
+
+ # Read the asset code from the hardware.
+ activateHWResult = None
+ hardwareInfo = None
+ hw_activation_code = None
+ try:
+ hardwareInfo = hardware.get_hal_system_and_smbios()
+ except:
+ log.log_me("There was an error while reading the hardware "
+ "info from the bios. Traceback:\n")
+ log.log_exception(*sys.exc_info())
+
+ if hardwareInfo is not None:
+ try:
+ activateHWResult = activateHardwareInfo(
+ login, password, hardwareInfo)
+ if activateHWResult.getStatus() == ActivationResult.ACTIVATED_NOW:
+ hw_activation_code = activateHWResult.getRegistrationNumber()
+ writeHWCode(hw_activation_code)
+ except up2dateErrors.NotEntitlingError:
+ log.log_debug('There are are no entitlements associated '
+ 'with this hardware.')
+ except up2dateErrors.InvalidRegistrationNumberError:
+ log.log_debug('The hardware id was not recognized as valid.')
+ return hw_activation_code
def activateHardwareInfo(username, password, hardwareInfo, orgId=None):
"""Tries to activate an entitlement linked to the hardware info that we
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 72bf2b5..fa505e6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -410,7 +410,9 @@ class OSReleaseWindow:
# can try to activate the hardware asset code here, before
# available_eus_channels gets called.
if self.tui.serverType == 'hosted':
- self.tui._activate_hardware()
+ hw_activation_code = rhnreg._activate_hardware(self.tui.userName, self.tui.password)
+ if hw_activation_code != None:
+ self.tui.other['registration_number'] = hw_activation_code
if not rhnreg.server_supports_eus():
log.log_debug("Server does not support EUS, skipping OSReleaseWindow")
@@ -1134,34 +1136,6 @@ class Tui:
self.packageList = []
self.selectedPackages = []
- def _activate_hardware(self):
-
- # Read the asset code from the hardware.
- activateHWResult = None
- hardwareInfo = None
- try:
- hardwareInfo = hardware.get_hal_system_and_smbios()
- except:
- log.log_me("There was an error while reading the hardware "
- "info from the bios. Traceback:\n")
- log.log_exception(*sys.exc_info())
-
- if hardwareInfo is not None:
- try:
- activateHWResult = rhnreg.activateHardwareInfo(
- self.userName, self.password,
- hardwareInfo)
- if activateHWResult.getStatus() == \
- rhnreg.ActivationResult.ACTIVATED_NOW:
- self.other['registration_number'] = \
- activateHWResult.getRegistrationNumber()
- rhnreg.writeHWCode(self.other['registration_number'])
- except up2dateErrors.NotEntitlingError:
- log.log_debug('There are are no entitlements associated '
- 'with this hardware.')
- except up2dateErrors.InvalidRegistrationNumberError:
- log.log_debug('The hardware id was not recognized as valid.')
-
def run(self):
log.log_debug("Running %s" % self.__class__.__name__)
self.initResults()
14 years, 1 month
Changes to 'refs/tags/spacewalk-java-0.9.15-1'
by Tomas Lestach
Tag 'spacewalk-java-0.9.15-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2010-04-02 08:20 +0000
Tagging package [spacewalk-java] version [0.9.15-1] in directory [java/].
Changes since spacewalk-utils-0.9.6-1:
Jan Pazdziora (10):
Do not hide warnings, we should address them instead.
The socket is not used in rhnregGui, we should not import it here.
Do not show the AlreadyRegisteredDialog if we came back to the StartPage via Back.
The rhnreg.registerUser (new_user) call is not needed as rhnreg.registerSystem2 validates the login/password as well.
Since we have self.customServerEntry for the satelliteServerEntry widget, let's be consistent and use it everywhere.
Rerun setUrlInWidget every time we are about to show the page.
Follow dot with space.
There is no reason not to allow Back in the Create Profile page.
Capitalize the page title.
Make the finish button now so wide.
Miroslav Suchý (1):
578738 - obsolete i386 package on x86_64 platform
Simon Lukasik (6):
Cleaning up, preparing for automatization
Cleaning up, preparing for automatization
Cleaning up, preparing for automatization
Cleaning up, preparing for automatization
Cleaning up, preparing for automatization
Cleaning up, preparing for automatization
Tomas Lestach (3):
fixing taskomatic problem
576907 - supporting multilib packages for syncing systems/profiles
Automatic commit of package [spacewalk-java] release [0.9.15-1].
---
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 18 -
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 28 --
client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py | 2
client/rhel/rhnlib/test/05-delete-packages.py | 20 -
client/rhel/rhnlib/test/06-leaking-ssl-fd.py | 85 ++++--
client/rhel/rhnlib/test/07-leaking-ssl-fd.py | 139 ++++++----
client/rhel/rhnlib/test/08-leaking-fd.py | 114 +++++---
client/rhel/rhnlib/test/09-test-errcodes.py | 25 +
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 1
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 2
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java | 19 -
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java | 4
java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java | 8
java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java | 37 ++
java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java | 12
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp | 8
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp | 2
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp | 4
java/spacewalk-java.spec | 13
monitoring/rhnmd/rhnmd.spec | 3
rel-eng/packages/spacewalk-java | 2
21 files changed, 384 insertions(+), 162 deletions(-)
---
14 years, 1 month
java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/spacewalk-java.spec | 13 ++++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 2ffc04a608251c5a47804edd0c2b648be4259882
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Apr 2 10:20:52 2010 +0200
Automatic commit of package [spacewalk-java] release [0.9.15-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index de334a6..0f5ab9f 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.9.14
+Version: 0.9.15
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -310,6 +310,17 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Apr 02 2010 Tomas Lestach <tlestach(a)redhat.com> 0.9.15-1
+- 576907 - supporting multilib packages for syncing systems/profiles
+ (tlestach(a)redhat.com)
+- fixing taskomatic problem (tlestach(a)redhat.com)
+- 577074 - Fix to remove invalid characters from a cobbler system record name
+ (paji(a)redhat.com)
+- 574594 - Fixed date based sorting issues on 4 User List pages.
+ (paji(a)redhat.com)
+- 577224 - Fixed an issue where when cloning KS profiles variables were not
+ getting copied (paji(a)redhat.com)
+
* Wed Mar 31 2010 Justin Sherrill <jsherril(a)redhat.com> 0.9.14-1
- 531122 - fixing issue where system records created with cobbler would not use
all the correct activation keys once keys were changed from a profile
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index e04ea72..5f4ef2e 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-0.9.14-1 java/
+0.9.15-1 java/
14 years, 1 month
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml | 1
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java | 19 +++--
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java | 4 -
java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java | 8 ++
java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java | 37 ++++++++++
java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java | 12 ++-
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp | 8 +-
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp | 2
java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp | 4 +
9 files changed, 81 insertions(+), 14 deletions(-)
New commits:
commit f4d30229c16b1ad5af1e1606ec1efce4fbcb800e
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed Mar 31 16:50:27 2010 +0200
576907 - supporting multilib packages for syncing systems/profiles
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index 03f14db..9eb006a 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -295,6 +295,7 @@ SELECT PN.id || '|' || PE.id || '|' || PA.id AS ID_COMBO,
PN.name,
PN.name || '-' || PE.evr.as_vre_simple() AS NVRE,
P.summary,
+ PA.id AS arch_id,
PE.epoch,
PE.version,
PE.release,
diff --git a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java
index fe844a2..abfeb4a 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageAction.java
@@ -42,8 +42,10 @@ import javax.servlet.http.HttpServletResponse;
*/
public class MissingPackageAction extends BaseProfilesAction {
- private static final CompareProfileSetupAction DECL_ACTION =
+ private static final CompareProfileSetupAction DECL_PROFILE_ACTION =
new CompareProfileSetupAction();
+ private static final CompareSystemSetupAction DECL_SYSTEM_ACTION =
+ new CompareSystemSetupAction();
private boolean isSystemSync(RequestContext rctx) {
String s = rctx.getParam("sync", true);
@@ -143,7 +145,7 @@ public class MissingPackageAction extends BaseProfilesAction {
RequestContext context = new RequestContext(request);
Long sid = context.getRequiredParam("sid");
Set <String> pkgIdCombos = SessionSetHelper.lookupAndBind(request,
- getDecl(sid));
+ getDecl(context, sid));
Map params = new HashMap();
params.put("sid", sid);
@@ -168,7 +170,7 @@ public class MissingPackageAction extends BaseProfilesAction {
RequestContext requestContext = new RequestContext(request);
Long sid = requestContext.getRequiredParam("sid");
Set <String> pkgIdCombos = SessionSetHelper.lookupAndBind(request,
- getDecl(sid));
+ getDecl(requestContext, sid));
Map params = new HashMap();
params.put("sid", sid);
@@ -186,7 +188,7 @@ public class MissingPackageAction extends BaseProfilesAction {
HttpServletRequest request) {
RequestContext requestContext = new RequestContext(request);
Long sid = requestContext.getRequiredParam("sid");
- Set <String> pkgIdCombos = SessionSetHelper.lookupAndBind(request, getDecl(sid));
+ Set <String> pkgIdCombos = SessionSetHelper.lookupAndBind(request, getDecl(requestContext, sid));
if (isProfileSync(requestContext)) {
Long prid = requestContext.getRequiredParam("prid");
@@ -215,7 +217,12 @@ public class MissingPackageAction extends BaseProfilesAction {
return map;
}
- protected String getDecl(Long sid) {
- return DECL_ACTION.getDecl(sid);
+ protected String getDecl(RequestContext context, Long sid) {
+ if (isSystemSync(context)) {
+ return DECL_SYSTEM_ACTION.getDecl(sid);
+ }
+ else {
+ return DECL_PROFILE_ACTION.getDecl(sid);
+ }
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java
index 4e77a71..0d31d0d 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/profile/MissingPackageSetupAction.java
@@ -40,9 +40,9 @@ import javax.servlet.http.HttpServletResponse;
*/
public class MissingPackageSetupAction extends RhnAction implements Listable {
- private static final CompareProfileSetupAction DECL_PROFILE_ACTION =
+ private static final CompareProfileSetupAction DECL_PROFILE_ACTION =
new CompareProfileSetupAction();
- private static final CompareSystemSetupAction DECL_SYSTEM_ACTION =
+ private static final CompareSystemSetupAction DECL_SYSTEM_ACTION =
new CompareSystemSetupAction();
/** {@inheritDoc} */
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java b/java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java
index 2ef6f76..ef1bc96 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/PackageListItem.java
@@ -479,6 +479,14 @@ public class PackageListItem extends IdComboDto {
ret.put("arch_id", getIdThree());
return ret;
}
+
+ /**
+ * Returns a unique id (nameId x archId) for HashMap
+ * @return a map id
+ */
+ public String getMapHash() {
+ return "" + getNameId() + "|" + getArchId();
+ }
/**
* Returns a list of Key map representation for a given list of package items
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java b/java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java
index 16ac004..fc0fdf1 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/PackageMetadata.java
@@ -244,6 +244,23 @@ public class PackageMetadata extends BaseDto implements Comparable {
}
/**
+ * Returns the arch of the Package, if both the system and
+ * other PackageListItem are null, returns null.
+ * @return the arch of the Package, if both the system and
+ * other PackageListItem are null, returns null.
+ */
+ public String getArch() {
+ if (system != null) {
+ return system.getArch();
+ }
+ else if (other != null) {
+ return other.getArch();
+ }
+
+ return null;
+ }
+
+ /**
* Returns the epoch of the Package, if both the system and
* other PackageListItem are null, returns null.
* @return the epoch of the Package, if both the system and
@@ -325,6 +342,18 @@ public class PackageMetadata extends BaseDto implements Comparable {
}
/**
+ * @return Returns target Nevra to be displayed on webui
+ */
+ public String getActionTargetNevra() {
+ if (comparison == KEY_THIS_ONLY) {
+ return system.getNevra();
+ }
+ else {
+ return other.getNevra();
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
public Long getId() {
@@ -375,6 +404,14 @@ public class PackageMetadata extends BaseDto implements Comparable {
}
/**
+ * Returns a unique id (nameId x archId) for HashMap
+ * @return a map id
+ */
+ public String getMapHash() {
+ return "" + getNameId() + "|" + getArchId();
+ }
+
+ /**
* Get the EVR of the System's rev of the RPM
* @return String EVR for the system
*/
diff --git a/java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java b/java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java
index 8f47be0..7397da7 100644
--- a/java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java
+++ b/java/code/src/com/redhat/rhn/manager/profile/ProfileManager.java
@@ -410,12 +410,13 @@ public class ProfileManager extends BaseManager {
// This is so we can have a List containing each package
// by name. Used for when we have multiple revs of the same
// package, kernel-2.1, kernel-2.2, kernel-2.3 etc..
- List list = (List) packages.get(item.getNameId());
+ String mapId = item.getMapHash();
+ List list = (List) packages.get(mapId);
if (list == null) {
list = new LinkedList();
}
list.add(item);
- packages.put(item.getNameId(), list);
+ packages.put(mapId, list);
}
return packages;
}
@@ -1105,8 +1106,13 @@ public class ProfileManager extends BaseManager {
PackageMetadata pm = (PackageMetadata) itr.next();
// retrieve the packages with the same name that exist w/in channels
List<PackageListItem> pkgsInChannel = (List<PackageListItem>)
- pkgsInChannelsByNameId.get(pm.getNameId());
+ pkgsInChannelsByNameId.get(pm.getMapHash());
+ if (pm.getComparisonAsInt() == PackageMetadata.KEY_THIS_ONLY) {
+ // makes no sense to check whether missing
+ continue;
+ }
+
// attempt to locate a package from pkgsInChannel that has the same nvre
// as the pkg to be synced
boolean foundMatch = false;
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp
index e1ca265..48cb4a6 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/compareprofiles.jsp
@@ -35,13 +35,17 @@
<rl:column headerkey="compare.jsp.package" bound="false" filterattr="name">
${current.name}
</rl:column>
+
+ <rl:column headerkey="packagelist.jsp.packagearch" bound="false">
+ ${current.arch}
+ </rl:column>
<rl:column headerkey="compare.jsp.thissystem" bound="false">
- ${current.system.evra}
+ ${current.system.evr}
</rl:column>
<rl:column headertext="${requestScope.profilename}" bound="false">
- ${current.other.evra}
+ ${current.other.evr}
</rl:column>
<rl:column headerkey="compare.jsp.difference" bound="false">
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp
index 3f1d5e5..ebf7783 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/missingpkgs.jsp
@@ -25,7 +25,7 @@
styleclass="list">
<rl:column headerkey="missingpkgs.jsp.package" bound="false">
- ${current.name}
+ ${current.actionTargetNevra}
</rl:column>
<rl:column headerkey="missingpkgs.jsp.channels" bound="false">
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp
index 953c4d8..f34f76d 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/packages/profiles/syncprofile.jsp
@@ -30,6 +30,10 @@
${current.name}
</rl:column>
+ <rl:column headerkey="packagelist.jsp.packagearch" bound="false">
+ ${current.arch}
+ </rl:column>
+
<rl:column headerkey="schedulesync.jsp.action" bound="false">
${current.actionStatus}
</rl:column>
14 years, 1 month
client/rhel
by Šimon Lukašík
client/rhel/rhnlib/test/09-test-errcodes.py | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
New commits:
commit 3fb6d517229c2741a6de1904731f1e405485a997
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Apr 2 09:21:20 2010 +0200
Cleaning up, preparing for automatization
diff --git a/client/rhel/rhnlib/test/09-test-errcodes.py b/client/rhel/rhnlib/test/09-test-errcodes.py
old mode 100644
new mode 100755
index bf5ffc3..fd3f3e2
--- a/client/rhel/rhnlib/test/09-test-errcodes.py
+++ b/client/rhel/rhnlib/test/09-test-errcodes.py
@@ -3,17 +3,28 @@
# munge the headers to produce an error message
#
# $Id$
+#
+# USAGE: $0 SERVER SYSTEMID
import sys
sys.path.append('..')
from rhn.rpclib import Server, GETServer, ProtocolError, reportError
-s = Server("http://xmlrpc.rhn.redhat.com/XMLRPC")
-if len(sys.argv) > 1:
- system_id_file = sys.argv[1]
-else:
- system_id_file = '/etc/sysconfig/rhn/systemid'
+SERVER = "xmlrpc.rhn.redhat.com"
+HANDLER = "/XMLRPC"
+system_id_file = '/etc/sysconfig/rhn/systemid'
+try:
+ SERVER = sys.argv[1]
+ system_id_file = sys.argv[2]
+except:
+ pass
+
+def get_test_server_https():
+ global SERVER, HANDLER
+ return Server("https://%s%s" % (SERVER, HANDLER))
+
+s = get_test_server_https()
sysid = open(system_id_file).read()
dict = s.up2date.login(sysid)
@@ -29,3 +40,7 @@ try:
l = sg.listPackages(channel_name, channel_version)
except ProtocolError, e:
print reportError(e.headers)
+ print("OK (error above expected)");
+ sys.exit(0);
+print("ERROR: Exception didn't occured!");
+sys.exit(-1);
14 years, 1 month