backend/common/rhnException.py | 3
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 4 +
client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py | 10 +-
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 3
client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py | 35 +++++++---
5 files changed, 41 insertions(+), 14 deletions(-)
New commits:
commit 3856179a57bd4a237cc6221a03ce59e0d159df06
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Dec 7 14:35:01 2012 -0500
885170 - provide translations of a new error recieved from Hosted
diff --git a/backend/common/rhnException.py b/backend/common/rhnException.py
index b8c6f61..69ed470 100644
--- a/backend/common/rhnException.py
+++ b/backend/common/rhnException.py
@@ -167,7 +167,7 @@ on this system."),
does not already exists on the server
"""),
55: _("""
- The --force rhnpush option is disabled on this server.
+ The --force rhnpush option is disabled on this server.
Please contact your Satellite administrator for more help.
"""),
@@ -192,6 +192,7 @@ on this system."),
"""),
72: _("""You can not unsubscribe from base
channel."""),
73: _("""Satellite or Proxy channel can not be
subscribed."""),
+ 74: _("") # not used, reserved for Hosted-only RegistrationDenied error.
# 80-90: server group errors
80: _("There was an error while trying to join the system to its
groups"),
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 3dc260e..bbb8449 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -293,6 +293,7 @@ class ChooseServerPage:
# If they changed the value, write it back to the config file.
if customServer != self.server:
config.setServerURL(customServer)
+ self.server = customServer
if not cfg['sslCACert']:
up2dateConfig.set('sslCACert',
'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT')
@@ -730,6 +731,9 @@ class CreateProfilePage:
except up2dateErrors.InsuffMgmntEntsError, e:
pwin.hide()
self.fatalError(_("Problem registering system:\n") + e.errmsg)
+ except up2dateErrors.RegistrationDeniedError, e:
+ pwin.hide()
+ self.fatalError(_("Problem registering system:\n") + e.errmsg)
except up2dateErrors.InvalidProductRegistrationError, e:
pwin.hide()
errorWindow(_("The installation number [ %s ] provided is not a valid
installation number. Please go back to the previous screen and fix it." %
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
index 671b96b..eb6553d 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
@@ -45,7 +45,7 @@ class _DoCallWrapper(object):
A callable object that will handle multiple levels of attributes,
and catch exceptions.
"""
-
+
def __init__(self, server, method_name):
self._server = server
self._method_name = method_name
@@ -80,7 +80,7 @@ class _DoCallWrapper(object):
raise up2dateErrors.SSLCertificateVerifyFailedError(), None,
sys.exc_info()[2]
else:
raise up2dateErrors.NetworkError(message), None, sys.exc_info()[2]
-
+
def __exception_from_fault(self, fault):
if fault.faultCode == -3:
# This username is already taken, or the password is incorrect.
@@ -118,6 +118,8 @@ class _DoCallWrapper(object):
exception = up2dateErrors.AbuseError(fault.faultString)
elif abs(fault.faultCode) == 60:
exception = up2dateErrors.AuthenticationTicketError(fault.faultString)
+ elif abs(fault.faultCode) == 74:
+ exception = up2dateErrors.RegistrationDeniedError()
elif abs(fault.faultCode) == 105:
exception = up2dateErrors.RhnUuidUniquenessError(fault.faultString)
elif fault.faultCode == 99:
@@ -156,8 +158,8 @@ class _DoCallWrapper(object):
class RhnServer(object):
- """
- An rpc server object that calls doCall for you, and catches lower
+ """
+ An rpc server object that calls doCall for you, and catches lower
level exceptions
"""
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 fd7d6ac..9429998 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -989,6 +989,9 @@ class SendingWindow:
except up2dateErrors.InsuffMgmntEntsError, e:
FatalErrorWindow(self.screen,
_("Problem registering system:\n") + e.errmsg)
+ except up2dateErrors.RegistrationDeniedError, e:
+ FatalErrorWindow(self.screen,
+ _("Problem registering system:\n") + e.errmsg)
except up2dateErrors.ActivationKeyUsageLimitError, e:
FatalErrorWindow(self.screen,
ACT_KEY_USAGE_LIMIT_ERROR)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
b/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
index 39174a4..1dd32d3 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
@@ -170,10 +170,27 @@ class ValidationError(NoLogError, RhnServerException):
class InvalidRegistrationNumberError(ValidationError):
pass
+class RegistrationDeniedError(RhnServerException):
+ def __init__(self):
+ RhnServerException.__init__(self, self.changeExplanation())
+
+ def __repr__(self):
+ return self.value
+
+ def changeExplanation(self):
+ return _("""
+Red Hat Network Classic is not supported.
+To register with Red Hat Subscription Management please run:
+
+ subscription-manager register --auto-attach
+
+Get more information at
access.redhat.com/knowledge
+ """)
+
class InvalidProductRegistrationError(NoLogError):
"""indicates an error during server input
validation"""
premsg = _("The installation number is invalid")
-
+
class OemInfoFileError(NoLogError):
premsg = _("Error parsing the oemInfo file at field:\n")
@@ -228,15 +245,15 @@ class SSLCertificateFileNotFound(Error):
class AuthenticationOrAccountCreationError(ValidationError):
"""Class that can represent different things depending on context:
- While logging in with an existing user it represents a username or password
+ While logging in with an existing user it represents a username or password
being incorrect.
- While creating a new account, it represents the username already being
+ While creating a new account, it represents the username already being
taken or the user not being allowed to create an account.
Optimally these different things would be different exceptions, but there
are single fault codes the server can return to the client that can mean
- more than one of them so we have no way of knowing which is actually
+ more than one of them so we have no way of knowing which is actually
intended.
-
+
"""
pass
@@ -272,19 +289,19 @@ class InsuffMgmntEntsError(RhnServerException):
def changeExplanation(self, msg):
newExpln = _("""
Your organization does not have enough Management entitlements to register this
- system to Red Hat Network. Please notify your organization administrator of this
error.
- You should be able to register this system after your organization frees existing
+ system to Red Hat Network. Please notify your organization administrator of this
error.
+ You should be able to register this system after your organization frees existing
or purchases additional entitlements. Additional entitlements may be purchased by
your
organization administrator by logging into Red Hat Network and visiting
the 'Subscription Management' page in the 'Your RHN' section of RHN.
-
+
A common cause of this error code is due to having mistakenly setup an
Activation Key which is set as the universal default. If an activation key is set
on the account as a universal default, you can disable this key and retry to avoid
requiring a Management entitlement.""")
term = "Explanation:"
loc = msg.rindex(term) + len(term)
- return msg[:loc] + newExpln
+ return msg[:loc] + newExpln
class NoSystemIdError(NoLogError):
pass