client/rhel/rhn-client-tools/src/bin/rhn_check.py | 12 +--
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 4 -
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 7 --
client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py | 4 -
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 7 +-
client/solaris/rhnclient/rhn/client/rhnHardware.py | 7 --
client/solaris/rhnclient/rhn/client/rhnReg.py | 34 +++++------
client/solaris/rhnclient/rhn/client/rpcServer.py | 5 -
client/solaris/rhnclient/rhn/rhn_check.py | 10 +--
client/solaris/rhnclient/rhn_check.py | 10 +--
client/tools/rhncfg/config_client/rpc_cli_repository.py | 6 -
client/tools/rhncfg/config_common/repository.py | 7 +-
client/tools/rhncfg/config_common/rhn_rpc.py | 1
client/tools/rhncfg/config_common/rpc_wrapper.py | 8 --
client/tools/rhncfg/config_management/rhncfg_remove.py | 5 -
client/tools/rhncfg/config_management/rpc_repository.py | 15 ++--
client/tools/rhncustominfo/rhn-custom-info.py | 3
client/tools/rhnpush/uploadLib.py | 10 +--
proxy/installer/rhn_proxy_activate.py | 21 +++---
proxy/proxy/apacheHandler.py | 5 -
proxy/proxy/broker/rhnRepository.py | 7 +-
proxy/proxy/rhnAuthCacheClient.py | 2
proxy/proxy/rhnAuthProtocol.py | 2
proxy/proxy/rhnProxyAuth.py | 13 ++--
24 files changed, 101 insertions(+), 104 deletions(-)
New commits:
commit bc50966463f364e010fc9c09ef502b6eb7cf62b6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:56:09 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(indirect import from rpclib has been removed)
diff --git a/proxy/installer/rhn_proxy_activate.py
b/proxy/installer/rhn_proxy_activate.py
index 39e18b0..8044a83 100644
--- a/proxy/installer/rhn_proxy_activate.py
+++ b/proxy/installer/rhn_proxy_activate.py
@@ -30,6 +30,7 @@ import sys
import string
import socket
import urlparse
+import xmlrpclib
## lib imports
from rhn import rpclib, SSL
@@ -212,13 +213,13 @@ def _errorHandler(pre='', post=''):
errorString = pre
try:
raise
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
errorCode, s = _getProtocolError(e)
errorString = errorString + s
except socket.error, e:
errorCode, s = _getSocketError(e)
errorString = errorString + s
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
errorCode, errorString = _getActivationError(e)
except SSL.SSL.Error, e:
errorCode = 13
@@ -277,14 +278,14 @@ def getAPIVersion(options):
version = s.api.system_version() # 3.1+ API
except (SystemExit, KeyboardInterrupt):
raise
- except rpclib.Fault:
+ except xmlrpclib.Fault:
sys.stderr.write("warning: can't check API version. Assuming at least
API version 3.0.0\n")
version = '3.0.0'
except SSL.SSL.Error:
errorCode, errorString = _errorHandler()
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
- except (rpclib.ProtocolError, socket.error):
+ except (xmlrpclib.ProtocolError, socket.error):
errorCode, errorString = _errorHandler()
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
@@ -330,7 +331,7 @@ def _deactivateProxy_api_v3_x(options, apiVersion):
errorCode, errorString = _errorHandler()
try:
raise
- except rpclib.Fault:
+ except xmlrpclib.Fault:
if errorCode == 8:
# fine. We weren't activated yet.
# noop and look like a success
@@ -341,7 +342,7 @@ def _deactivateProxy_api_v3_x(options, apiVersion):
except SSL.SSL.Error:
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
- except (rpclib.ProtocolError, socket.error):
+ except (xmlrpclib.ProtocolError, socket.error):
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
except:
@@ -375,10 +376,10 @@ def _activateProxy_api_v3_x(options, apiVersion):
# let's force a system exit for this one.
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
- except (rpclib.Fault, Exception):
+ except (xmlrpclib.Fault, Exception):
# let's force a slight change in messaging for this one.
errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
- except (rpclib.ProtocolError, socket.error):
+ except (xmlrpclib.ProtocolError, socket.error):
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
except:
@@ -411,10 +412,10 @@ def createMonitoringScout(options):
# let's force a system exit for this one.
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
- except (rpclib.Fault, Exception):
+ except (xmlrpclib.Fault, Exception):
# let's force a slight change in messaging for this one.
errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
- except (rpclib.ProtocolError, socket.error):
+ except (xmlrpclib.ProtocolError, socket.error):
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
except:
diff --git a/proxy/proxy/apacheHandler.py b/proxy/proxy/apacheHandler.py
index 9badebc..89b3460 100644
--- a/proxy/proxy/apacheHandler.py
+++ b/proxy/proxy/apacheHandler.py
@@ -21,6 +21,7 @@
import os
import base64
import string
+import xmlrpclib
from rhnConstants import *
from rhn import rpclib, connections
@@ -362,7 +363,7 @@ class apacheHandler(rhnApache):
""" convert a response to the right type for passing back to
rpclib.xmlrpclib.dumps
"""
- if isinstance(response, rpclib.Fault):
+ if isinstance(response, xmlrpclib.Fault):
return response
return (response,)
@@ -434,7 +435,7 @@ class apacheHandler(rhnApache):
compress_response = rhnFlags.test("compress_response")
# Init an output object; we'll use it for sending data in various
# formats
- if isinstance(response, rpclib.File):
+ if isinstance(response, rpclib.transports.File):
if not hasattr(response.file_obj, 'fileno') and compress_response:
# This is a StringIO that has to be compressed, so read it in
# memory; mark that we don't have to do any xmlrpc encoding
diff --git a/proxy/proxy/broker/rhnRepository.py b/proxy/proxy/broker/rhnRepository.py
index a78bdbf..e50b6d4 100644
--- a/proxy/proxy/broker/rhnRepository.py
+++ b/proxy/proxy/broker/rhnRepository.py
@@ -27,6 +27,7 @@ import string
import cPickle
import types
from operator import truth
+import xmlrpclib
## common imports
from spacewalk.common import rhnRepository, log_debug, log_error, CFG, rhnFault
@@ -123,7 +124,7 @@ class Repository(rhnRepository.Repository):
try:
retval = server.proxy.package_source_in_channel(
pkgFilename, self.channelName, self.clientInfo)
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
raise rhnFault(1000,
_("Error retrieving source package: %s") % str(e))
if not retval:
@@ -235,9 +236,9 @@ def listPackages(function, channel, version):
try:
return function(channel, version)
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
errcode, errmsg = rpclib.reportError(e.headers)
- raise rhnFault(1000, "RHN Proxy error (rpclib.ProtocolError): "
+ raise rhnFault(1000, "RHN Proxy error (xmlrpclib.ProtocolError): "
"errode=%s; errmsg=%s" % (errcode, errmsg))
diff --git a/proxy/proxy/rhnAuthCacheClient.py b/proxy/proxy/rhnAuthCacheClient.py
index df20cc5..23b16c9 100644
--- a/proxy/proxy/rhnAuthCacheClient.py
+++ b/proxy/proxy/rhnAuthCacheClient.py
@@ -26,7 +26,7 @@ import socket
from spacewalk.common import log_debug, log_error, Traceback, rhnFault
from spacewalk.common.rhnTranslate import _
from rhnAuthProtocol import CommunicationError, send, recv
-from xxmlrpclib import Fault
+from xmlrpclib import Fault
#
# Protocol description:
diff --git a/proxy/proxy/rhnAuthProtocol.py b/proxy/proxy/rhnAuthProtocol.py
index a12b6c2..c76501d 100644
--- a/proxy/proxy/rhnAuthProtocol.py
+++ b/proxy/proxy/rhnAuthProtocol.py
@@ -19,7 +19,7 @@
import struct
## local imports
-from xxmlrpclib import dumps, loads
+from xmlrpclib import dumps, loads
class CommunicationError(Exception):
diff --git a/proxy/proxy/rhnProxyAuth.py b/proxy/proxy/rhnProxyAuth.py
index 37220c4..292dbd5 100644
--- a/proxy/proxy/rhnProxyAuth.py
+++ b/proxy/proxy/rhnProxyAuth.py
@@ -21,10 +21,11 @@ import os
import time
import string
import socket
+import xmlrpclib
## local imports
import rhnAuthCacheClient
-from xxmlrpclib import rpclib, Fault, loads
+from xxmlrpclib import rpclib
from rhn import SSL
## common imports
@@ -98,7 +99,7 @@ class ProxyAuth:
"Please contact your system administrator."))
# get serverid
- sysid, cruft = loads(ProxyAuth.__systemid)
+ sysid, cruft = xmlrpclib.loads(ProxyAuth.__systemid)
ProxyAuth.__serverid = sysid[0]['system_id'][3:]
log_debug(7, 'SystemId: "%s[...snip snip...]%s"' \
@@ -267,12 +268,12 @@ problems, isn't running, or the token is somehow corrupt.
Traceback(mail=0)
time.sleep(.25)
continue
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
token = None
- log_error('rpclib.ProtocolError', e)
+ log_error('xmlrpclib.ProtocolError', e)
time.sleep(.25)
continue
- except Fault, e:
+ except xmlrpclib.Fault, e:
# Report it through the mail
# Traceback will try to walk over all the values
# in each stack frame, and eventually will try to stringify
@@ -303,7 +304,7 @@ problems, isn't running, or the token is somehow corrupt.
if not token:
if error:
- if error[0] in ('rpclib.ProtocolError', 'socket.error',
'socket'):
+ if error[0] in ('xmlrpclib.ProtocolError',
'socket.error', 'socket'):
raise rhnFault(1000,
_("RHN Proxy error (error: %s). "
"Please contact your system administrator.")
% error[0])
commit ec681ec83f32edf593d33897a812a42a4d7b0c4a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:56:09 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(indirect import from rpclib has been removed)
diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index 1d0d1d5..e43c174 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -21,6 +21,7 @@ import fnmatch
import getpass
import rhnpush_cache
import struct
+import xmlrpclib
from spacewalk.common import rhn_mpm
from spacewalk.common.checksum import getFileChecksum
@@ -30,7 +31,6 @@ try:
Output = rpclib.transports.Output
except ImportError:
# old-style xmlrpclib library
- import xmlrpclib
rpclib = xmlrpclib
Binary = rpclib.Binary
import cgiwrap
@@ -634,14 +634,14 @@ def call(function, *params):
# Wrapper function
try:
ret = apply(function, params)
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
x = parseXMLRPCfault(e)
if x.faultString:
print x.faultString
if x.faultExplanation:
print x.faultExplanation
sys.exit(-1)
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
print e.errmsg
sys.exit(-1)
@@ -652,7 +652,7 @@ def raw_call(function, *params):
def parseXMLRPCfault(fault):
- if not isinstance(fault, rpclib.Fault):
+ if not isinstance(fault, xmlrpclib.Fault):
return None
faultCode = fault.faultCode
if faultCode and isinstance(faultCode, type(1)):
@@ -714,7 +714,7 @@ def exists_getPackageChecksumBySession(server):
ret = True
try:
raw_call(server.packages.getPackageChecksumBySession, '', {})
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode in [-2, -33]:
# Fault -33: session token is invalid
# i.e. function exists but we supplied wrong data
commit 46fc2ed29cf3300962581f5f5bb55dcf300ff962
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:56:09 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(indirect import from rpclib has been removed)
diff --git a/client/tools/rhncustominfo/rhn-custom-info.py
b/client/tools/rhncustominfo/rhn-custom-info.py
index a522768..320cd64 100755
--- a/client/tools/rhncustominfo/rhn-custom-info.py
+++ b/client/tools/rhncustominfo/rhn-custom-info.py
@@ -19,6 +19,7 @@ import sys
import os
import string
import getpass
+import xmlrpclib
from re import search
from optparse import OptionParser
@@ -229,7 +230,7 @@ def main():
else:
ret = s.system.set_custom_values(session, int(sid), values)
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -1:
system_exit(1, "Error code: %s\nInvalid login information.\n" %
e.faultCode)
else:
commit 42651943b36b09cb05b1ddf861aae6a12591608f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:56:09 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(indirect import from rpclib has been removed)
diff --git a/client/tools/rhncfg/config_client/rpc_cli_repository.py
b/client/tools/rhncfg/config_client/rpc_cli_repository.py
index 6dd2891..0d5cc0d 100644
--- a/client/tools/rhncfg/config_client/rpc_cli_repository.py
+++ b/client/tools/rhncfg/config_client/rpc_cli_repository.py
@@ -15,10 +15,10 @@
import os
import sys
+import xmlrpclib
from config_common import local_config, cfg_exceptions, file_utils, \
repository
-from config_common.rhn_rpc import rpclib
from config_common.rhn_log import log_debug
import traceback
@@ -49,7 +49,7 @@ class ClientRepository(repository.RPC_Repository):
try:
result = apply(repository.RPC_Repository.rpc_call,
(self, method_name) + params)
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -9:
# System not subscribed
raise cfg_exceptions.AuthenticationError(
@@ -118,7 +118,7 @@ class ClientRepository(repository.RPC_Repository):
try:
self.rpc_call('config.client.upload_file',
self.system_id, action_id, params)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
fault_code, fault_string = e.faultCode, e.faultString
# deal with particular faults
if fault_code == -4003:
diff --git a/client/tools/rhncfg/config_common/repository.py
b/client/tools/rhncfg/config_common/repository.py
index 6c094bc..6de2b90 100644
--- a/client/tools/rhncfg/config_common/repository.py
+++ b/client/tools/rhncfg/config_common/repository.py
@@ -24,6 +24,7 @@ import cfg_exceptions
import local_config
import base64
import utils
+import xmlrpclib
from rhn_log import log_debug
@@ -292,7 +293,7 @@ class RPC_Repository(Repository):
# without setting any state on the server side
try:
x_server.registration.welcome_message()
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
sys.stderr.write("XML-RPC error while talking to %s:\n %s\n" %
(self.__server_url, e))
sys.exit(2)
@@ -363,10 +364,10 @@ class RPC_Repository(Repository):
method = getattr(self.server, method_name)
try:
result = apply(method, params)
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
sys.stderr.write("XML-RPC call error: %s\n" % e)
sys.exit(1)
- except rpclib.Fault:
+ except xmlrpclib.Fault:
# Re-raise them
raise
except Exception, e:
diff --git a/client/tools/rhncfg/config_common/rhn_rpc.py
b/client/tools/rhncfg/config_common/rhn_rpc.py
index bd514eb..94a835e 100644
--- a/client/tools/rhncfg/config_common/rhn_rpc.py
+++ b/client/tools/rhncfg/config_common/rhn_rpc.py
@@ -24,4 +24,3 @@ except ImportError:
import xmlrpclib
rpclib = xmlrpclib
-Fault = rpclib.Fault
diff --git a/client/tools/rhncfg/config_common/rpc_wrapper.py
b/client/tools/rhncfg/config_common/rpc_wrapper.py
index 3de6729..4789376 100644
--- a/client/tools/rhncfg/config_common/rpc_wrapper.py
+++ b/client/tools/rhncfg/config_common/rpc_wrapper.py
@@ -16,6 +16,7 @@
import sys
import string
from rhn_rpc import rpclib
+import xmlrpclib
try:
from socket import error, sslerror, herror, gaierror, timeout
except ImportError:
@@ -25,11 +26,6 @@ except ImportError:
gaierror = error
timeout = error
-#Expose the rpclib Exceptions so they can be accessed as if they're implemented
here.
-Fault = rpclib.Fault
-ResponseError = rpclib.ResponseError
-ProtocolError = rpclib.ProtocolError
-
#This is raised when the failover stuff has gone through every server in the server list
#and the error is still occurring.
class NoMoreServers(Exception):
@@ -165,7 +161,7 @@ class Server(rpclib.Server):
ret = apply(function, arglist, kwargs)
except rpclib.InvalidRedirectionError:
raise
- except rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
try:
self._failover()
except NoMoreServers, f:
diff --git a/client/tools/rhncfg/config_management/rhncfg_remove.py
b/client/tools/rhncfg/config_management/rhncfg_remove.py
index c04d027..73de1cf 100644
--- a/client/tools/rhncfg/config_management/rhncfg_remove.py
+++ b/client/tools/rhncfg/config_management/rhncfg_remove.py
@@ -14,8 +14,9 @@
#
import os
-from config_common import handler_base, utils, repository
+from config_common import handler_base, utils
from config_common.rhn_log import log_debug, die
+import xmlrpclib
class Handler(handler_base.HandlerBase):
_usage_options = "[options] file [ file ... ]"
@@ -67,7 +68,7 @@ class Handler(handler_base.HandlerBase):
for (local_file, remote_file) in files_to_remove:
try:
r.remove_file(channel, remote_file)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4011:
print "%s does not exist" % remote_file
continue
diff --git a/client/tools/rhncfg/config_management/rpc_repository.py
b/client/tools/rhncfg/config_management/rpc_repository.py
index ab53629..26731e5 100644
--- a/client/tools/rhncfg/config_management/rpc_repository.py
+++ b/client/tools/rhncfg/config_management/rpc_repository.py
@@ -15,6 +15,7 @@
import os
import tempfile
+import xmlrpclib
from config_common import cfg_exceptions, repository, utils, file_utils
from config_common.rhn_log import log_debug
@@ -54,7 +55,7 @@ class Repository(repository.RPC_Repository):
'username' : self.username,
'password' : self.password,
})
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
fault_code, fault_string = e.faultCode, e.faultString
if fault_code == -2:
raise cfg_exceptions.AuthenticationError(
@@ -90,7 +91,7 @@ class Repository(repository.RPC_Repository):
params['revision'] = revision
try:
result = self.rpc_call('config.management.get_file', params)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4011:
# File not present
raise cfg_exceptions.RepositoryFileMissingError(config_channel,
@@ -156,7 +157,7 @@ class Repository(repository.RPC_Repository):
try:
result = self.rpc_call('config.management.put_file', params)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
fault_code, fault_string = e.faultCode, e.faultString
if is_first_revision and fault_code == -4013:
@@ -204,7 +205,7 @@ class Repository(repository.RPC_Repository):
try:
revisions = self.rpc_call('config.management.list_file_revisions',
params)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4011:
# File not present
raise cfg_exceptions.RepositoryFileMissingError(
@@ -230,7 +231,7 @@ class Repository(repository.RPC_Repository):
try:
return self.rpc_call('config.management.create_config_channel',
{'session' : self.session, 'config_channel' :
config_channel})
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4010:
raise cfg_exceptions.ConfigChannelAlreadyExistsError(config_channel)
raise
@@ -241,7 +242,7 @@ class Repository(repository.RPC_Repository):
try:
return self.rpc_call('config.management.remove_config_channel',
{'session' : self.session, 'config_channel' :
config_channel})
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4009:
raise cfg_exceptions.ConfigChannelNotInRepo(config_channel)
if e.faultCode == -4005:
@@ -281,7 +282,7 @@ class Repository(repository.RPC_Repository):
params['revision_dst'] = revision_dst
try:
ret = self.rpc_call('config.management.diff', params)
- except repository.rpclib.Fault, e:
+ except xmlrpclib.Fault, e:
if e.faultCode == -4011:
# File not present
raise cfg_exceptions.RepositoryFileMissingError(e.faultString)
commit 3f229f1a99f41e1af72adc668d61e78ae7dcad37
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:56:09 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(indirect import from rpclib has been removed)
diff --git a/client/solaris/rhnclient/rhn/client/rhnHardware.py
b/client/solaris/rhnclient/rhn/client/rhnHardware.py
index 10d510b..aa163d8 100644
--- a/client/solaris/rhnclient/rhn/client/rhnHardware.py
+++ b/client/solaris/rhnclient/rhn/client/rhnHardware.py
@@ -5,11 +5,6 @@ import xmlrpclib
import rpcServer
import hardware
-try:
- from rhn import rpclib
-except ImportError:
- rpclib = __import__("xmlrpclib")
-
def updateHardware():
@@ -20,7 +15,7 @@ def updateHardware():
try:
rhnAuth.updateLoginInfo()
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
faultError(f.faultString)
sys.exit(1)
except rhnErrors.ServerCapabilityError, e:
diff --git a/client/solaris/rhnclient/rhn/client/rhnReg.py
b/client/solaris/rhnclient/rhn/client/rhnReg.py
index cf832eb..90d063c 100755
--- a/client/solaris/rhnclient/rhn/client/rhnReg.py
+++ b/client/solaris/rhnclient/rhn/client/rhnReg.py
@@ -17,7 +17,7 @@ import config
from translate import _
-from rhn import rpclib
+import xmlrpclib
# global variables
SYSID_DIR = config.RHN_SYSCONFIG_DIR
@@ -160,7 +160,7 @@ def welcomeText():
try:
return rpcServer.doCall(s.registration.welcome_message)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -172,7 +172,7 @@ def privacyText():
try:
return rpcServer.doCall(s.registration.privacy_statement)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -187,7 +187,7 @@ def finishMessage(systemId):
try:
ret = rpcServer.doCall(s.registration.finish_message, systemId)
return ret
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -199,7 +199,7 @@ def getCaps():
try:
rpcServer.doCall(s.registration.welcome_message)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -217,7 +217,7 @@ def termsAndConditions():
try:
return rpcServer.doCall(s.registration.terms_and_conditions)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -228,7 +228,7 @@ def reserveUser(username, password):
try:
ret = rpcServer.doCall(s.registration.reserve_user, username, password)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == -3:
# account already in use
raise rhnErrors.ValidationError(f.faultString)
@@ -250,7 +250,7 @@ def validateRegNum(regNum):
try:
rpcServer.doCall(s.registration.validate_reg_num,regNum)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == -16:
# invalid
raise rhnErrors.ValidationError(f.faultString)
@@ -274,7 +274,7 @@ def registerUser(username, password,
username, password, email)
else:
rpcServer.doCall(s.registration.new_user, username, password)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -315,7 +315,7 @@ def registerSystem(username = None, password = None,
ret = rpcServer.doCall(s.registration.new_system,
auth_dict,
packages)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if abs(f.faultCode) == 99:
raise rhnErrors.DelayError(f.faultString)
elif abs(f.faultCode) == 60:
@@ -334,7 +334,7 @@ def registerProduct(systemId, productInfo, oemInfo={}):
try:
rpcServer.doCall(s.registration.register_product,
systemId, productInfo)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -350,7 +350,7 @@ def sendSerialNumber(systemId, num):
cfg["oemId"])
else:
rpcServer.doCall(s.registration.send_serial, systemId, num)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -362,7 +362,7 @@ def sendHardware(systemId, hardwareList):
try:
rpcServer.doCall(s.registration.add_hw_profile, systemId, hardwareList)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -373,7 +373,7 @@ def sendPackages(systemId, packageList):
try:
rpcServer.doCall(s.registration.add_packages, systemId, packageList)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -384,7 +384,7 @@ def updatePackages(systemId, packageList):
try:
rpcServer.doCall(s.registration.update_packages, systemId, packageList)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -395,7 +395,7 @@ def listPackages(systemId):
try:
rpcServer.doCall(s.registration.list_packages,systemId)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise rhnErrors.DelayError(f.faultString)
else:
@@ -412,7 +412,7 @@ def up2datePackages(systemId):
# try:
# rpcServer.doCall(s.registration.add_packages,
# systemId, rpmUtils.getInstalledPackageList())
-# except rpclib.Fault, f:
+# except xmlrpclib.Fault, f:
# if f.faultCode == 99:
# raise up2dateErrors.DelayError(f.faultString)
# else:
diff --git a/client/solaris/rhnclient/rhn/client/rpcServer.py
b/client/solaris/rhnclient/rhn/client/rpcServer.py
index d893998..22ead0b 100644
--- a/client/solaris/rhnclient/rhn/client/rpcServer.py
+++ b/client/solaris/rhnclient/rhn/client/rpcServer.py
@@ -18,6 +18,7 @@ import string
import time
import httplib
import urllib2
+import xmlrpclib
# so we can use the same code with python 1.5.2 and 2.2
try:
@@ -141,7 +142,7 @@ def doCall(method, *args, **kwargs):
log.log_me(msg)
raise rhnErrors.CommunicationError(msg)
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
log.log_me("A protocol error occurred: %s , attempt #%s," % (
e.errmsg, attempt_count))
@@ -190,7 +191,7 @@ def doCall(method, *args, **kwargs):
else:
failure = 1
- except rpclib.ResponseError:
+ except xmlrpclib.ResponseError:
raise rhnErrors.CommunicationError(
"Broken response from the server.")
diff --git a/client/solaris/rhnclient/rhn/rhn_check.py
b/client/solaris/rhnclient/rhn/rhn_check.py
index 3c4c7b5..4f5985f 100755
--- a/client/solaris/rhnclient/rhn/rhn_check.py
+++ b/client/solaris/rhnclient/rhn/rhn_check.py
@@ -34,7 +34,7 @@ from client import config
from client import clientCaps
from client import capabilities
-from rhn import rpclib
+import xmlrpclib
cfg = config.initUp2dateConfig()
log = rhnLog.initLog()
@@ -84,7 +84,7 @@ def submit_response(action_id, status, message, data):
try:
ret = rpcServer.doCall(server.queue.submit,rhnAuth.getSystemId(),
action_id, status, message, data)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
print "Could not submit results to server %s" % server
print "Error code: %d%s" % (f.faultCode, f.faultString)
sys.exit(-1)
@@ -127,7 +127,7 @@ def check_action(action):
print action
# the -99 here is kind of magic
submit_response(action["id"],
- rpclib.Fault(-99, "Can not handle this version"))
+ xmlrpclib.Fault(-99, "Can not handle this version"))
return -1
return 0
@@ -171,7 +171,7 @@ def handle_action(action):
action_id, version))
# Decipher the data
- parser, decoder = rpclib.getparser()
+ parser, decoder = xmlrpclib.getparser()
parser.feed(data)
parser.close()
params = decoder.close()
@@ -265,7 +265,7 @@ while 1:
try:
action = rpcServer.doCall(server.queue.get,rhnAuth.getSystemId(),
ACTION_VERSION, Status)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
print "Could not retrieve action item from server %s" % server
print "Error code: %d%s" % (f.faultCode, f.faultString)
sys.exit(-1)
diff --git a/client/solaris/rhnclient/rhn_check.py
b/client/solaris/rhnclient/rhn_check.py
index a76accf..c7783a3 100755
--- a/client/solaris/rhnclient/rhn_check.py
+++ b/client/solaris/rhnclient/rhn_check.py
@@ -34,7 +34,7 @@ from rhn.client import config
from rhn.client import clientCaps
from rhn.client import capabilities
-from rhn import rpclib
+import xmlrpclib
cfg = config.initUp2dateConfig()
log = rhnLog.initLog()
@@ -84,7 +84,7 @@ def submit_response(action_id, status, message, data):
try:
ret = rpcServer.doCall(server.queue.submit,rhnAuth.getSystemId(),
action_id, status, message, data)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
print "Could not submit results to server %s" % server
print "Error code: %d%s" % (f.faultCode, f.faultString)
sys.exit(-1)
@@ -127,7 +127,7 @@ def check_action(action):
print action
# the -99 here is kind of magic
submit_response(action["id"],
- rpclib.Fault(-99, "Can not handle this version"))
+ xmlrpclib.Fault(-99, "Can not handle this version"))
return -1
return 0
@@ -171,7 +171,7 @@ def handle_action(action):
action_id, version))
# Decipher the data
- parser, decoder = rpclib.getparser()
+ parser, decoder = xmlrpclib.getparser()
parser.feed(data)
parser.close()
params = decoder.close()
@@ -265,7 +265,7 @@ while 1:
try:
action = rpcServer.doCall(server.queue.get,rhnAuth.getSystemId(),
ACTION_VERSION, Status)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
print "Could not retrieve action item from server %s" % server
print "Error code: %d%s" % (f.faultCode, f.faultString)
sys.exit(-1)
commit c4cbea5dd3d79eee887905c3388d4c36a145e1cf
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Dec 7 23:54:41 2010 +0100
import Fault, ResponseError and ProtocolError directly from xmlrpclib
(ndirect import from rpclib has been removed)
diff --git a/client/rhel/rhn-client-tools/src/bin/rhn_check.py
b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
index 1e7b09b..5a3d68a 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhn_check.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
@@ -35,7 +35,7 @@ from up2date_client import capabilities
from up2date_client import rhncli, rhnserver
from rhn import rhnLockfile
-from rhn import rpclib
+import xmlrpclib
cfg = config.initUp2dateConfig()
log = up2dateLog.initLog()
@@ -83,7 +83,7 @@ class CheckCli(rhncli.RhnCli):
ACTION_VERSION, status_report)
return action
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == -31:
raise up2dateErrors.InsuffMgmntEntsError(f.faultString)
else:
@@ -116,7 +116,7 @@ class CheckCli(rhncli.RhnCli):
actions = self.server.queue.get_future_actions(up2dateAuth.getSystemId(),
time_window)
return actions
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == -31:
raise up2dateErrors.InsuffMgmntEntsError(f.faultString)
else:
@@ -189,7 +189,7 @@ class CheckCli(rhncli.RhnCli):
def __parse_action_data(self, action):
""" Parse action data and returns (method, params)
"""
data = action['action']
- parser, decoder = rpclib.getparser()
+ parser, decoder = xmlrpclib.getparser()
parser.feed(data)
parser.close()
params = decoder.close()
@@ -205,7 +205,7 @@ class CheckCli(rhncli.RhnCli):
try:
ret = self.server.queue.submit(up2dateAuth.getSystemId(),
action_id, status, message, data)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
print "Could not submit results to server %s" % self.server
print "Error code: %d%s" % (f.faultCode, f.faultString)
sys.exit(-1)
@@ -260,7 +260,7 @@ class CheckCli(rhncli.RhnCli):
print action
# the -99 here is kind of magic
self.submit_response(action["id"],
- rpclib.Fault(-99, "Can not handle this version"))
+ xmlrpclib.Fault(-99, "Can not handle this
version"))
return False
return True
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 eb38c9c..e22aec1 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -21,7 +21,7 @@ gtk.glade.bindtextdomain("rhn-client-tools",
"/usr/share/locale")
import gnome.ui
import signal
-from rhn import rpclib
+import xmlrpclib
import gettext
_ = gettext.gettext
@@ -337,7 +337,7 @@ def main():
if __name__ == "__main__":
try:
main()
- except rpclib.ResponseError, e:
+ except xmlrpclib.ResponseError, e:
print e
except IOError, e:
print _("There was some sort of I/O error: %s") % e.errmsg
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 c3db94d..a48885b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -21,10 +21,7 @@ import hardware
from rhnPackageInfo import convertPackagesFromHashToList
from types import ListType, TupleType, StringType, UnicodeType, DictType, DictionaryType
-try:
- from rhn import rpclib
-except ImportError:
- rpclib = __import__("xmlrpclib")
+import xmlrpclib
try:
from virtualization import support
@@ -353,7 +350,7 @@ def getAvailableChannels(username, password):
username, password,
server_arch, server_version,
server_release)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
if f.faultCode == 99:
raise up2dateErrors.DelayError(f.faultString)
else:
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 7288f0c..fb35151 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnserver.py
@@ -22,7 +22,7 @@ import rpcServer
import up2dateErrors
import capabilities
-from rhn import rpclib
+import xmlrpclib
import OpenSSL
@@ -48,7 +48,7 @@ class _DoCallWrapper(object):
try:
return rpcServer.doCall(method, *args, **kwargs)
- except rpclib.Fault, f:
+ except xmlrpclib.Fault, f:
raise self.__exception_from_fault(f)
except OpenSSL.SSL.Error, e:
# TODO This should probably be moved to rhnlib and raise an
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
index e5953cf..9aae28f 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
@@ -15,6 +15,7 @@ import up2dateErrors
import up2dateUtils
import up2dateAuth
+import xmlrpclib
from rhn import rpclib
import gettext
@@ -39,7 +40,7 @@ class RetryServer(rpclib.Server):
ret = self._request(methodname, params)
except rpclib.InvalidRedirectionError:
raise
- except rpclib.Fault:
+ except xmlrpclib.Fault:
raise
except httplib.BadStatusLine:
self.log.log_me("Error: Server Unavailable. Please try later.")
@@ -226,7 +227,7 @@ def doCall(method, *args, **kwargs):
log.log_me(msg)
raise up2dateErrors.CommunicationError(msg)
- except rpclib.ProtocolError, e:
+ except xmlrpclib.ProtocolError, e:
log.log_me("A protocol error occurred: %s , attempt #%s," % (
e.errmsg, attempt_count))
@@ -276,7 +277,7 @@ def doCall(method, *args, **kwargs):
else:
failure = 1
- except rpclib.ResponseError:
+ except xmlrpclib.ResponseError:
raise up2dateErrors.CommunicationError(
"Broken response from the server.")