backend/server/handlers/app/packages.py | 5 ++++-
client/tools/rhnpush/rhnpush.py | 2 +-
client/tools/rhnpush/rhnpush.sgml | 2 +-
client/tools/rhnpush/uploadLib.py | 18 +++++++-----------
proxy/proxy/pm/rhn_package_manager.py | 2 ++
proxy/proxy/pm/rhn_package_manager.sgml | 6 ++++++
6 files changed, 21 insertions(+), 14 deletions(-)
New commits:
commit 775c73607c6908bac95b0a41c6a9e91faeecc0fa
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 10:06:10 2011 +0200
678053 - add option --no-session-caching to rhn_package_manager
diff --git a/proxy/proxy/pm/rhn_package_manager.py
b/proxy/proxy/pm/rhn_package_manager.py
index 7466156..337e6d0 100755
--- a/proxy/proxy/pm/rhn_package_manager.py
+++ b/proxy/proxy/pm/rhn_package_manager.py
@@ -76,6 +76,8 @@ def main():
Option( '--copyonly', action='store_true', help="Only
copy packages; don't reimport"),
Option( '--test', action='store_true', help='Only
print the packages to be pushed'),
Option( '--no-ssl', action='store_true', help='Turn
off SSL (not recommended).'),
+ Option( '--no-session-caching', action='store_true',
+ help='Disables session-token authentication.'),
Option('-?','--usage', action='store_true',
help="Briefly describe the options"),
]
# Process the command line arguments
diff --git a/proxy/proxy/pm/rhn_package_manager.sgml
b/proxy/proxy/pm/rhn_package_manager.sgml
index 8a995a5..4c010d7 100644
--- a/proxy/proxy/pm/rhn_package_manager.sgml
+++ b/proxy/proxy/pm/rhn_package_manager.sgml
@@ -162,6 +162,12 @@ Manages RPM packages for the RHN proxy
<para>Turn off SSL (not recommended).</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>--no-session-caching</term>
+ <listitem>
+ <para>This option disabled session token authentication. Useful if you
want to push to two or more different servers.</para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>-h, --help</term>
<listitem>
commit 698504378070e46be17e338f493005c928249167
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 09:58:24 2011 +0200
do not test if rhnParent can handle session caching
All servers since RHN Satellite 4.0.6 can do that.
But do not remove --no-session-caching since it can be useful when
you change rhnParent.
diff --git a/backend/server/handlers/app/packages.py
b/backend/server/handlers/app/packages.py
index 7b24bb1..53714de 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -85,7 +85,10 @@ class Packages(RPC_Base):
self.functions.append('getSourcePackageMD5sumBySession')
def no_op(self):
- """ This is so the client can tell if the satellite supports
session tokens or not. """
+ """ This is so the client can tell if the satellite supports
session tokens or not.
+
+ This was used in rhnpush-5.5.26 and older. When there will be no such version
of rhnpush in wild,
+ then this function can be safely removed."""
return 1
def uploadPackageInfo(self, username, password, info):
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index 40566df..ce7d4b1 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -83,7 +83,7 @@ def main():
Option( '--no-cache', action='store_true', help='Do not
create a username/password cache'),
Option( '--extended-test', action='store_true',
help='Perform a more verbose test'),
Option( '--no-session-caching', action='store_true',
- help='Disables session-token support. Useful for using rhnpush with
pre-4.0.6 satellites.'),
+ help='Disables session-token authentication.'),
Option( '--tolerant', action='store_true',
help='If rhnpush errors while uploading a package, continue uploading the
rest of the packages.')
]
diff --git a/client/tools/rhnpush/rhnpush.sgml b/client/tools/rhnpush/rhnpush.sgml
index 8c89b46..c76f69e 100644
--- a/client/tools/rhnpush/rhnpush.sgml
+++ b/client/tools/rhnpush/rhnpush.sgml
@@ -292,7 +292,7 @@ Utility to push binary and source RPMs into an RHN channel.
<varlistentry>
<term>--no-session-caching</term>
<listitem>
- <para>This option disabled session token support. Useful for satellites
older than 4.0.6</para>
+ <para>This option disabled session token authentication. Useful if you
want to push to two or more different servers.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index dcd4bc6..5925105 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -478,19 +478,15 @@ class UploadClass:
else:
self.setUsernamePassword()
- #1/3/06 wregglej 173287 rhnpush needs to work against older satellites, so we need a
way to see if they can handle
- #session token authentication
def new_sat_test(self):
+ """ test if we can use session caching
+
+ Historically this function was used to test if rhnParent can handle session
token authentication.
+ All curent satellites (4.0.6+) can do that. So it only return False, if we
use --no-session-cachine.
+ """
if self.new_sat is None:
- if self.options.no_session_caching:
- self.new_sat = 0
- else:
- self.new_sat = 1
- try:
- self.server.packages.no_op()
- except:
- self.new_sat = 0
- return self.new_sat
+ self.new_sat = not self.options.no_session_caching
+ return self.new_sat
def _processFile(self, filename, relativeDir=None, source=None, nosig=None):
""" Processes a file