contrib/rhn-clone-errata.py | 4 ++--
contrib/swapi.py | 11 +++--------
proxy/installer/rhn_proxy_activate.py | 12 ++++++------
proxy/proxy/rhnProxyAuth.py | 2 +-
4 files changed, 12 insertions(+), 17 deletions(-)
New commits:
commit ce86cbdcdb2598a3a7e98cd9ccb38759dbef7a68
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jan 4 09:45:25 2011 +0100
import rpclib directly from rhn
diff --git a/proxy/proxy/rhnProxyAuth.py b/proxy/proxy/rhnProxyAuth.py
index 292dbd5..43c9fe8 100644
--- a/proxy/proxy/rhnProxyAuth.py
+++ b/proxy/proxy/rhnProxyAuth.py
@@ -25,7 +25,7 @@ import xmlrpclib
## local imports
import rhnAuthCacheClient
-from xxmlrpclib import rpclib
+from rhn import rpclib
from rhn import SSL
## common imports
commit 4916ec1ab13473789867d401bb18fd295838ae95
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jan 4 09:26:44 2011 +0100
fixed E0701:382:_activateProxy_api_v3_x: Bad except clauses order (Exception is an
ancestor class of ProtocolError)
E0701:418:createMonitoringScout: Bad except clauses order (Exception is an ancestor
class of ProtocolError)
diff --git a/proxy/installer/rhn_proxy_activate.py
b/proxy/installer/rhn_proxy_activate.py
index 476a1ff..1799d40 100644
--- a/proxy/installer/rhn_proxy_activate.py
+++ b/proxy/installer/rhn_proxy_activate.py
@@ -376,12 +376,12 @@ 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 (xmlrpclib.Fault, Exception):
- # let's force a slight change in messaging for this one.
- errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
except (xmlrpclib.ProtocolError, socket.error):
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
+ except (xmlrpclib.Fault, Exception):
+ # let's force a slight change in messaging for this one.
+ errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
except:
errorString = "ERROR: upon activation attempt (something unexpected):
%s" % errorString
return errorCode, errorString
@@ -412,12 +412,12 @@ def createMonitoringScout(options):
# let's force a system exit for this one.
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
- except (xmlrpclib.Fault, Exception):
- # let's force a slight change in messaging for this one.
- errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
except (xmlrpclib.ProtocolError, socket.error):
sys.stderr.write(errorString + '\n')
sys.exit(errorCode)
+ except (xmlrpclib.Fault, Exception):
+ # let's force a slight change in messaging for this one.
+ errorString = "ERROR: upon entitlement/activation attempt: %s" %
errorString
except:
errorString = "ERROR: upon activation attempt (something unexpected):
%s" % errorString
return errorCode, errorString
commit fb22baa6a40e2e96103d0b0e92d77d0826280305
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jan 4 09:22:07 2011 +0100
fixed E1101: 58:hexdigest: Module 'hashlib' has no 'md5' member
diff --git a/contrib/swapi.py b/contrib/swapi.py
index 53898d7..31b239a 100755
--- a/contrib/swapi.py
+++ b/contrib/swapi.py
@@ -53,13 +53,9 @@ import xmlrpclib
try:
- import hashlib # python 2.5+
- def hexdigest(s):
- return hashlib.md5(s).hexdigest()
+ from hashlib import md5 # python 2.5+
except ImportError:
- import md5
- def hexdigest(s):
- return md5.md5(s).hexdigest()
+ from md5 import md5
@@ -183,8 +179,7 @@ CACHE_EXPIRING_DATES = 1 # [days]
def str_to_id(s):
- return hexdigest(s)
-
+ return md5(s).hexdigest()
def object_to_id(obj):
"""Object -> id.
commit 1c64d788af1dc4cf8cb853e411d7bffcc46e15f5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jan 4 08:52:09 2011 +0100
fixed E1101: 55:RHNServer.cloneErrata: Instance of 'RHNServer' has no
'self' member
E1101: 67:RHNServer.listChannelErrata: Instance of 'RHNServer' has no
'self' member
diff --git a/contrib/rhn-clone-errata.py b/contrib/rhn-clone-errata.py
index 4d5d451..e929975 100755
--- a/contrib/rhn-clone-errata.py
+++ b/contrib/rhn-clone-errata.py
@@ -52,7 +52,7 @@ class RHNServer:
except xmlrpclib.Fault, f:
if f.faultCode==-20:
self.rhnLogin(self.login,self.password)
- return self.self.server.errata.clone(self.rhnSession,dest_chan,errata)
+ return self.server.errata.clone(self.rhnSession,dest_chan,errata)
else:
raise
return out
@@ -64,7 +64,7 @@ class RHNServer:
except xmlrpclib.Fault, f:
if f.faultCode==-20:
self.rhnLogin(self.login,self.password)
- return self.self.server.errata.listByDate(self.rhnSession,channel_label)
+ return self.server.errata.listByDate(self.rhnSession,channel_label)
else:
raise
return out
Show replies by date