client/rhel/rhn-client-tools/rhn-client-tools.spec | 6 - client/rhel/rhn-client-tools/src/actions/Makefile | 2 client/rhel/rhn-client-tools/src/actions/errata.py | 87 --------------------- client/rhel/rhnlib/rhn/connections.py | 11 -- client/rhel/yum-rhn-plugin/actions/errata.py | 86 ++++++++++++++++++++ client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5 - rel-eng/packages/rhn-client-tools | 2 rel-eng/packages/yum-rhn-plugin | 2 8 files changed, 101 insertions(+), 100 deletions(-)
New commits: commit 5f353abf6953a38b63732d7ca8d0ae616026209a Author: Miroslav Suchý msuchy@redhat.com Date: Tue Oct 18 20:40:36 2011 +0200
Automatic commit of package [yum-rhn-plugin] release [1.6.13-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec index df1f31a..dabd6a7 100644 --- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec +++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec @@ -1,6 +1,6 @@ Summary: RHN support for yum Name: yum-rhn-plugin -Version: 1.6.12 +Version: 1.6.13 Release: 1%{?dist} License: GPLv2 Group: System Environment/Base @@ -72,6 +72,9 @@ fi %doc LICENSE
%changelog +* Tue Oct 18 2011 Miroslav Suchý 1.6.13-1 +- move errata.py action to the yum-rhn-plugin package (iartarisi@suse.cz) + * Fri Oct 07 2011 Michael Mraka michael.mraka@redhat.com 1.6.12-1 - pass error messages from yum plugin to rhn_check
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin index 4b7f185..b7af1a5 100644 --- a/rel-eng/packages/yum-rhn-plugin +++ b/rel-eng/packages/yum-rhn-plugin @@ -1 +1 @@ -1.6.12-1 client/rhel/yum-rhn-plugin/ +1.6.13-1 client/rhel/yum-rhn-plugin/
commit 0a8dafd1d10c6d9111725102561b2772199ee019 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Oct 18 20:40:26 2011 +0200
Automatic commit of package [rhn-client-tools] release [1.6.24-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec index 51292fb..15e1b4a 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/%%7Bname%7D-%%7Bversion%7D.t... URL: https://fedorahosted.org/spacewalk Name: rhn-client-tools -Version: 1.6.23 +Version: 1.6.24 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -338,6 +338,9 @@ make -f Makefile.rhn-client-tools test %endif
%changelog +* Tue Oct 18 2011 Miroslav Suchý 1.6.24-1 +- move errata.py action to the yum-rhn-plugin package (iartarisi@suse.cz) + * Tue Oct 11 2011 Tomas Lestach tlestach@redhat.com 1.6.23-1 - 706148 - set _uri, when connecting to a different server (luvilla@redhat.com)
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools index 004daf7..ec2a243 100644 --- a/rel-eng/packages/rhn-client-tools +++ b/rel-eng/packages/rhn-client-tools @@ -1 +1 @@ -1.6.23-1 client/rhel/rhn-client-tools/ +1.6.24-1 client/rhel/rhn-client-tools/
commit 561ee725dd0f6fc2acdc6fef70b211c71fd18ea8 Author: Ionuț Arțăriși iartarisi@suse.cz Date: Tue Oct 18 16:49:24 2011 +0200
move errata.py action to the yum-rhn-plugin package
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec index 8d9f58b..51292fb 100644 --- a/client/rhel/rhn-client-tools/rhn-client-tools.spec +++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec @@ -249,7 +249,6 @@ make -f Makefile.rhn-client-tools test # actions for rhn_check to run %{_datadir}/rhn/actions/__init__.* %{_datadir}/rhn/actions/hardware.* -%{_datadir}/rhn/actions/errata.* %{_datadir}/rhn/actions/systemid.* %{_datadir}/rhn/actions/reboot.* %{_datadir}/rhn/actions/rhnsd.* diff --git a/client/rhel/rhn-client-tools/src/actions/Makefile b/client/rhel/rhn-client-tools/src/actions/Makefile index 2d72848..fec4eff 100644 --- a/client/rhel/rhn-client-tools/src/actions/Makefile +++ b/client/rhel/rhn-client-tools/src/actions/Makefile @@ -3,7 +3,7 @@ # $Id$
ACTIONS = up2date_config hardware reboot \ - rhnsd systemid errata __init__ + rhnsd systemid __init__ PYFILES = $(addsuffix .py, $(ACTIONS)) OBJECTS = $(PYFILES) $(addsuffix .pyc, $(ACTIONS))
diff --git a/client/rhel/rhn-client-tools/src/actions/errata.py b/client/rhel/rhn-client-tools/src/actions/errata.py deleted file mode 100644 index 49f1c65..0000000 --- a/client/rhel/rhn-client-tools/src/actions/errata.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python - -# Client code for Update Agent -# Copyright (c) 1999-2002 Red Hat, Inc. Distributed under GPL. -# -# Author: Adrian Likins <alikins@redhat.com -# - -import sys -sys.path.append("/usr/share/rhn/") -from up2date_client import rhnserver -from up2date_client import up2dateAuth -from up2date_client import pkgUtils -from actions import packages - -__rhnexport__ = [ - 'update'] - -# action version we understand -ACTION_VERSION = 2 - -def __getErrataInfo(errata_id): - s = rhnserver.RhnServer() - return s.errata.getErrataInfo(up2dateAuth.getSystemId(), errata_id) - -def update(errataidlist, cache_only=None): - packagelist = [] - - if type(errataidlist) not in [type([]), type(())]: - errataidlist = [ errataidlist ] - - for errataid in errataidlist: - tmpList = __getErrataInfo(errataid) - packagelist = packagelist + tmpList - - current_packages_with_arch = {} - current_packages ={} - for p in pkgUtils.getInstalledPackageList(getArch=1): - current_packages_with_arch[p['name']+p['arch']] = p - current_packages[p['name']] = p - - u = {} - # only update packages that are currently installed - # since an "applicable errata" may only contain some packages - # that actually apply. aka kernel. Fun fun fun. - - if len(packagelist[0]) > 4: - # Newer sats send down arch, filter using name+arch - for p in packagelist: - if current_packages_with_arch.has_key(p[0]+p[4]): - u[p[0]+p[4]] = p - elif current_packages_with_arch.has_key(p[0]+"noarch"): - u[p[0]+p[4]] = p - elif p[4] == "noarch" and current_packages.has_key(p[0]): - u[p[0]] = p - else: - # 5.2 and older sats + hosted dont send arch - for p in packagelist: - if current_packages.has_key(p[0]): - u[p[0]] = p - - - # XXX: Fix me - once we keep all errata packages around, - # this is the WRONG thing to do - we want to keep the specific versions - # that the user has asked for. - packagelist = map(lambda a: u[a], u.keys()) - - if packagelist == []: - data = {} - data['version'] = "0" - data['name'] = "errata.update.no_packages" - data['erratas'] = errataidlist - - return (39, - "No packages from that errata are available", - data) - - return packages.update(packagelist, cache_only) - - -def main(): - print update([23423423]) - - -if __name__ == "__main__": - main() - diff --git a/client/rhel/yum-rhn-plugin/actions/errata.py b/client/rhel/yum-rhn-plugin/actions/errata.py new file mode 100644 index 0000000..03a4bb9 --- /dev/null +++ b/client/rhel/yum-rhn-plugin/actions/errata.py @@ -0,0 +1,86 @@ +#!/usr/bin/python + +# Client code for Update Agent +# Copyright (c) 1999-2002 Red Hat, Inc. Distributed under GPL. +# +# Author: Adrian Likins <alikins@redhat.com +# + +import sys +sys.path.append("/usr/share/rhn/") +from up2date_client import rhnserver +from up2date_client import up2dateAuth +from up2date_client import pkgUtils +from actions import packages + +__rhnexport__ = [ + 'update'] + +# action version we understand +ACTION_VERSION = 2 + +def __getErrataInfo(errata_id): + s = rhnserver.RhnServer() + return s.errata.getErrataInfo(up2dateAuth.getSystemId(), errata_id) + +def update(errataidlist, cache_only=None): + packagelist = [] + + if type(errataidlist) not in [type([]), type(())]: + errataidlist = [ errataidlist ] + + for errataid in errataidlist: + tmpList = __getErrataInfo(errataid) + packagelist = packagelist + tmpList + + current_packages_with_arch = {} + current_packages ={} + for p in pkgUtils.getInstalledPackageList(getArch=1): + current_packages_with_arch[p['name']+p['arch']] = p + current_packages[p['name']] = p + + u = {} + # only update packages that are currently installed + # since an "applicable errata" may only contain some packages + # that actually apply. aka kernel. Fun fun fun. + + if len(packagelist[0]) > 4: + # Newer sats send down arch, filter using name+arch + for p in packagelist: + if current_packages_with_arch.has_key(p[0]+p[4]): + u[p[0]+p[4]] = p + elif current_packages_with_arch.has_key(p[0]+"noarch"): + u[p[0]+p[4]] = p + elif p[4] == "noarch" and current_packages.has_key(p[0]): + u[p[0]] = p + else: + # 5.2 and older sats + hosted dont send arch + for p in packagelist: + if current_packages.has_key(p[0]): + u[p[0]] = p + + + # XXX: Fix me - once we keep all errata packages around, + # this is the WRONG thing to do - we want to keep the specific versions + # that the user has asked for. + packagelist = map(lambda a: u[a], u.keys()) + + if packagelist == []: + data = {} + data['version'] = "0" + data['name'] = "errata.update.no_packages" + data['erratas'] = errataidlist + + return (39, + "No packages from that errata are available", + data) + + return packages.update(packagelist, cache_only) + + +def main(): + print update([23423423]) + + +if __name__ == "__main__": + main()
commit 1ec69c63f3ebed1330d3315c40a74459cafba2d1 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Oct 18 16:02:50 2011 +0200
simplify code
diff --git a/client/rhel/rhnlib/rhn/connections.py b/client/rhel/rhnlib/rhn/connections.py index 2667c75..cd9c0bb 100644 --- a/client/rhel/rhnlib/rhn/connections.py +++ b/client/rhel/rhnlib/rhn/connections.py @@ -18,9 +18,7 @@ import socket from platform import python_version
# Import into the local namespace some httplib-related names -_CS_REQ_SENT = httplib._CS_REQ_SENT -_CS_IDLE = httplib._CS_IDLE -ResponseNotReady = httplib.ResponseNotReady +from httplib import _CS_REQ_SENT, _CS_IDLE, ResponseNotReady
class HTTPResponse(httplib.HTTPResponse): def set_callback(self, rs, ws, ex, user_data, callback):
commit 9a6821d9af8bbb43541df14bd742cdc2d2413673 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Oct 18 16:00:37 2011 +0200
move imports to beginning of file
diff --git a/client/rhel/rhnlib/rhn/connections.py b/client/rhel/rhnlib/rhn/connections.py index 2403bf8..2667c75 100644 --- a/client/rhel/rhnlib/rhn/connections.py +++ b/client/rhel/rhnlib/rhn/connections.py @@ -8,11 +8,14 @@ # $Id$
+import base64 import SSL import nonblocking import httplib import xmlrpclib import encodings.idna +import socket +from platform import python_version
# Import into the local namespace some httplib-related names _CS_REQ_SENT = httplib._CS_REQ_SENT @@ -29,7 +32,6 @@ class HTTPConnection(httplib.HTTPConnection): response_class = HTTPResponse
def __init__(self, host, port=None): - from platform import python_version if python_version() >= '2.6.1': httplib.HTTPConnection.__init__(self, host, port, timeout=SSL.DEFAULT_TIMEOUT) else: @@ -140,7 +142,6 @@ class HTTPProxyConnection(HTTPConnection): if not self.__username: return # Authenticated proxy - import base64 userpass = "%s:%s" % (self.__username, self.__password) enc_userpass = base64.encodestring(userpass).replace("\n", "") self.putheader("Proxy-Authorization", "Basic %s" % enc_userpass) @@ -156,8 +157,6 @@ class HTTPSConnection(HTTPConnection):
def connect(self): "Connect to a host on a given (SSL) port" - import socket - results = socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM)
spacewalk-commits@lists.fedorahosted.org