backend/common/rhnCache.py | 14 ++++++--------
backend/common/rhnConfig.py | 15 +++++----------
backend/satellite_exporter/constants.py | 20 +++++++++++++++++++-
backend/satellite_tools/connection.py | 3 ++-
backend/satellite_tools/exporter/exporter.py | 1 -
backend/satellite_tools/satellite-sync.sgml | 2 +-
backend/satellite_tools/test/test-download.py | 2 +-
backend/satellite_tools/test/test-errata.py | 2 +-
backend/satellite_tools/xmlSource.py | 1 +
9 files changed, 36 insertions(+), 24 deletions(-)
New commits:
commit a886cdc61a95ec99925c63bdee47bab17f938ffd
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Jan 6 12:09:55 2010 +0100
add comments to what some xml dump version means
diff --git a/backend/satellite_exporter/constants.py
b/backend/satellite_exporter/constants.py
index 1c71404..a0c968e 100644
--- a/backend/satellite_exporter/constants.py
+++ b/backend/satellite_exporter/constants.py
@@ -32,3 +32,12 @@ EUS_SUPPORTED_VERSION = 3.2
# Support for virt details (rhn500+)
VIRT_SUPPORTED_VERSION = 3.1
+
+# Historical log
+# * Version 2.2 2004-03-02
+# arch types introduced in all the arch dumps
+# * Version 2.3 2004-09-13
+# added short package dumps per channel
+# * Version 3.0 2005-01-13
+# required major version change for channel family merging (#136525)
+
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 2af35ff..2b346dc 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -250,6 +250,7 @@ class BaseDispatchHandler(ContentHandler, ErrorHandler):
# Particular case: a satellite handler
class SatelliteDispatchHandler(BaseDispatchHandler):
rootElement = 'rhn-satellite'
+ # this is last version of channel dump we support
version = "3.0"
# Historical log
commit 4224697a524bc860894de87b54dd7ef0711f122d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Jan 6 12:09:20 2010 +0100
175155 - bump up protocol version to 3.5
we need to bump it up to 3.4 which means we support to CD
but we have new feature too, SHA256, so bumping up directly to 3.5
diff --git a/backend/satellite_exporter/constants.py
b/backend/satellite_exporter/constants.py
index 1d66ead..1c71404 100644
--- a/backend/satellite_exporter/constants.py
+++ b/backend/satellite_exporter/constants.py
@@ -16,7 +16,16 @@
Constant values (protocol versions, etc) for satellite sync/exporter.
"""
-PROTOCOL_VERSION = 3.3
+PROTOCOL_VERSION = 3.5
+
+# Support for checksums other then md5
+SHA256_SUPPORTED_VERSION = 3.5
+
+# Support for redirects to CDN (Akamai)
+REDIRECTS_SUPPORTED_VERSION = 3.4
+
+# Support for supplying comps.xml files (package groups)
+COMPS_SUPPORTED_VERSION = 3.3
# Support for update model details (rhn510+)
EUS_SUPPORTED_VERSION = 3.2
diff --git a/backend/satellite_tools/connection.py
b/backend/satellite_tools/connection.py
index 3e26a62..ee7f401 100644
--- a/backend/satellite_tools/connection.py
+++ b/backend/satellite_tools/connection.py
@@ -22,6 +22,7 @@ import string
import gzipstream
from rhn import rpclib
+from satellite_exporter import constants
__version__ = "0.1"
@@ -89,7 +90,7 @@ class _Server(rpclib.Server):
class StreamConnection(_Server):
def __init__(self, uri, proxy=None, username=None, password=None,
- refreshCallback=None, xml_dump_version="3.3"):
+ refreshCallback=None, xml_dump_version=constants.PROTOCOL_VERSION):
_Server.__init__(self, uri, proxy=proxy, username=username,
password=password, refreshCallback=refreshCallback)
self.add_header("X-RHN-Satellite-XML-Dump-Version", xml_dump_version)
diff --git a/backend/satellite_tools/satellite-sync.sgml
b/backend/satellite_tools/satellite-sync.sgml
index 23ee69e..ed7e7ae 100644
--- a/backend/satellite_tools/satellite-sync.sgml
+++ b/backend/satellite_tools/satellite-sync.sgml
@@ -7,7 +7,7 @@
<RefMeta>
<RefEntryTitle>satellite-sync</RefEntryTitle><manvolnum>8</manvolnum>
-<RefMiscInfo>Version 3.3.0</RefMiscInfo>
+<RefMiscInfo>Version 4.0.0</RefMiscInfo>
</RefMeta>
<RefNameDiv>
diff --git a/backend/satellite_tools/test/test-download.py
b/backend/satellite_tools/test/test-download.py
index 8ec838d..2c826b5 100644
--- a/backend/satellite_tools/test/test-download.py
+++ b/backend/satellite_tools/test/test-download.py
@@ -26,7 +26,7 @@ if __name__ == '__main__':
#s =
StreamConnection("http://xmlrpc.rhn.webqa.redhat.com/SAT-DUMP",
s =
StreamConnection("http://satellite.rhn.redhat.com/SAT-DUMP",
#s =
StreamConnection("http://xmlrpc.rhn.webdev.redhat.com/SAT-DUMP",
- xml_dump_version="3.0")
+ )
systemid = open("systemid-satellite-live").read()
#systemid = open("systemid-test01-devel").read()
#systemid = open("/tmp/systemid-test05").read()
diff --git a/backend/satellite_tools/test/test-errata.py
b/backend/satellite_tools/test/test-errata.py
index 5b76233..28f62b6 100644
--- a/backend/satellite_tools/test/test-errata.py
+++ b/backend/satellite_tools/test/test-errata.py
@@ -19,7 +19,7 @@ if __name__ == '__main__':
#s =
StreamConnection("http://rhnapp.webdev-colo.redhat.com/SAT-DUMP",
#s =
StreamConnection("http://roadrunner.devel.redhat.com/SAT-DUMP",
#s =
StreamConnection("http://coyote.devel.redhat.com/SAT-DUMP",
- xml_dump_version="2.0")
+ )
systemid = open("systemid-satellite-live").read()
f = s.dump.errata(systemid, ["rhn-erratum-1018"])
print f.read()
commit 8940ec1ba2a8c4d5e1932516b06b0a1c6921f800
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Jan 6 12:08:51 2010 +0100
code cleanup - xml_dump_version in this class (nor its childs) is never used
diff --git a/backend/satellite_tools/exporter/exporter.py
b/backend/satellite_tools/exporter/exporter.py
index 1360097..ce5e4f7 100644
--- a/backend/satellite_tools/exporter/exporter.py
+++ b/backend/satellite_tools/exporter/exporter.py
@@ -148,7 +148,6 @@ def all_channels():
class Dumper:
- xml_dump_version = "2.0"
buffer_size = 65536
def __init__(self, server_url, actions, compression=9, options=None):
commit 7de1e3adbd3ec43bcc0db243a288b443bebe231f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jan 5 10:20:36 2010 +0100
convert comments to docstring
diff --git a/backend/common/rhnConfig.py b/backend/common/rhnConfig.py
index c437595..46b65ba 100644
--- a/backend/common/rhnConfig.py
+++ b/backend/common/rhnConfig.py
@@ -41,13 +41,6 @@ class ConfigParserError(Exception):
pass
-# Main options class
-# FIXME: needs an overhaul. Way way way too complex.
-#
-# Singleton-esque:
-# The basic idea is to share the important pieces of information - the
-# component and the configuration tree - across all instances of this
-# class.
# TODO: need to be able to specify "" component and parse all files in
# the directory and form a _complete_ mapping structure.
# Or, if that is too difficult, take in a list of components...
@@ -55,10 +48,12 @@ class ConfigParserError(Exception):
# of config options, compare to the default options and write to
# /etc/rhn/rhn.conf if those options differ at all.
# XXX: almost done
-
-
class RHNOptions:
-
+ """ Main options class
+ The basic idea is to share the important pieces of information - the
+ component and the configuration tree - across all instances of this
+ class.
+ """
def __init__(self, component=None, root=None, file=None):
self.__component = None
# Defaults for each option, keyed on tuples
commit 665f3c6e5a0135ccb2e4599d24801bfa21f60cbc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jan 5 10:17:24 2010 +0100
code cleanup - removal of long time commented code
diff --git a/backend/common/rhnCache.py b/backend/common/rhnCache.py
index 5e9d612..7de54ae 100644
--- a/backend/common/rhnCache.py
+++ b/backend/common/rhnCache.py
@@ -192,10 +192,6 @@ class LockedFile(object):
self.fd.close()
self.closed = True
-# def __del__(self):
-# if not self.closed:
-# self.close()
-
def __getattr__(self, x):
return getattr(self.fd, x)
commit fba08b9117bc243b82301269d15f2b7ca9ba172f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Jan 5 10:16:37 2010 +0100
convert comments to docstring
diff --git a/backend/common/rhnCache.py b/backend/common/rhnCache.py
index 8c4ad37..5e9d612 100644
--- a/backend/common/rhnCache.py
+++ b/backend/common/rhnCache.py
@@ -106,11 +106,13 @@ class UnreadableFileError(Exception):
pass
-# This function returns a file descriptor for the open file fname
-# If the file is already there, it is truncated
-# otherwise, all the directories up to it are created and the file is created
-# as well
def _safe_create(fname, user, group, mode):
+ """ This function returns a file descriptor for the open file fname
+ If the file is already there, it is truncated
+ otherwise, all the directories up to it are created and the file is created
+ as well.
+ """
+
# There can be race conditions between the moment we check for the file
# existence and when we actually create it, so retry if something fails
tries = 5