client/rhel/rhn-client-tools/src/up2date_client/clientCaps.py | 4 - client/tools/rhnpush/rhnpush.spec | 2 client/tools/rhnpush/uploadLib.py | 25 ++++------ 3 files changed, 13 insertions(+), 18 deletions(-)
New commits: commit 8bdb009008bf6161fb5808c8c29f5ae273cce461 Author: Miroslav Suchý msuchy@redhat.com Date: Fri Jan 28 22:11:24 2011 +0100
648403 - do not create TB even on Red Hat Enterprise Linux 4
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec index fe155ba..dea49b9 100644 --- a/client/tools/rhnpush/rhnpush.spec +++ b/client/tools/rhnpush/rhnpush.spec @@ -10,7 +10,7 @@ Release: 1%{?dist} Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -Requires: rpm-python, rhnlib +Requires: rpm-python, rhnlib, rhncfg Requires: spacewalk-backend-libs >= 0.8.3 %if 0%{?rhel} && 0%{?rhel} <= 5 Requires: up2date diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py index a6e96ee..7bc7e41 100644 --- a/client/tools/rhnpush/uploadLib.py +++ b/client/tools/rhnpush/uploadLib.py @@ -15,6 +15,7 @@
# system imports import os +import re import sys import string import fnmatch @@ -24,6 +25,8 @@ import struct import xmlrpclib from spacewalk.common import rhn_mpm from spacewalk.common.checksum import getFileChecksum +from config_common.repository import get_server_capability + try: from up2date_client import rhnserver rhnserver_available = True @@ -724,21 +727,13 @@ def exists_getPackageChecksumBySession(rpc_server): server._server = rpc_server result = server.capabilities.hasCapability('xmlrpc.packages.extended_profile', 2) else: # rhel4 has no rhnserver - result = True - try: # if server do not have this function we will create TB :( - raw_call(rpc_server.packages.getPackageChecksumBySession, '', {}) - 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 - # Fault -2 session is unknown - expected when empty - pass - elif e.faultCode == -1: - # Fault -1: function invalid - result = False - else: - # pass through anything else - raise + server_capabilities = get_server_capability(rpc_server) + if 'xmlrpc.packages.extended_profile' in server_capabilities: + # that capability can be '1' or '1-2', this is hackish + result = server_capabilities['xmlrpc.packages.extended_profile']['version'] > '1' and \ + server_capabilities['xmlrpc.packages.extended_profile']['value'] # usually '1' + else: + result = False return result
# compare two package [n,v,r,e] tuples
commit ec1a072fd191069bfb4f798b119d6a4fd856c2d3 Author: Miroslav Suchý msuchy@redhat.com Date: Fri Jan 28 21:34:13 2011 +0100
break circular import
addressing: Traceback (most recent call last): File "/usr/bin/rhnpush", line 12, in ? mod = __import__("rhnpush." + mod_name) File "rhnpush.py", line 50, in ? File "/usr/share/rhn/rhnpush/uploadLib.py", line 28, in ? from up2date_client.capabilities import Capabilities File "/usr/share/rhn/up2date_client/capabilities.py", line 12, in ? import rpcServer File "/usr/share/rhn/up2date_client/rpcServer.py", line 15, in ? import clientCaps File "/usr/share/rhn/up2date_client/clientCaps.py", line 70, in ? loadLocalCaps() File "/usr/share/rhn/up2date_client/clientCaps.py", line 63, in loadLocalCaps caplist = capabilities.parseCap(line) AttributeError: module object has no attribute parseCap
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/clientCaps.py b/client/rhel/rhn-client-tools/src/up2date_client/clientCaps.py index 7442dbd..3981475 100644 --- a/client/rhel/rhn-client-tools/src/up2date_client/clientCaps.py +++ b/client/rhel/rhn-client-tools/src/up2date_client/clientCaps.py @@ -7,7 +7,7 @@ import glob import os import string
-import capabilities +from capabilities import parseCap
class ClientCapabilities(UserDict.UserDict): def __init__(self): @@ -51,7 +51,7 @@ def loadLocalCaps(capsDir = "/etc/sysconfig/rhn/clientCaps.d"): string.strip(line) if line[0] == "#": continue - caplist = capabilities.parseCap(line) + caplist = parseCap(line)
for (cap,data) in caplist: caps.data[cap] = data