client/rhel/rhnlib/rhn/connections.py | 24 ++++++++++++++----------
client/rhel/rhnlib/rhnlib.spec | 6 +++++-
proxy/proxy/apacheHandler.py | 3 +++
proxy/proxy/redirect/rhnRedirect.py | 12 +++++++++---
proxy/proxy/rhn-conf/rhn_proxy.conf | 1 +
proxy/proxy/rhnShared.py | 2 ++
proxy/proxy/spacewalk-proxy.spec | 9 +++++++--
rel-eng/packages/rhnlib | 2 +-
rel-eng/packages/spacewalk-proxy | 2 +-
9 files changed, 43 insertions(+), 18 deletions(-)
New commits:
commit 7e31d775f30f36a32413c9f8d8c5fca459dc2115
Author: Stephen Herr <sherr(a)redhat.com>
Date: Tue Apr 2 18:43:31 2013 -0400
Automatic commit of package [spacewalk-proxy] release [1.10.1-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index 064e907..5b15008 100644
--- a/proxy/proxy/spacewalk-proxy.spec
+++ b/proxy/proxy/spacewalk-proxy.spec
@@ -4,7 +4,7 @@ Group: Applications/Internet
License: GPLv2
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.10.0
+Version: 1.10.1
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
@@ -330,6 +330,11 @@ fi
%changelog
+* Tue Apr 02 2013 Stephen Herr <sherr(a)redhat.com> 1.10.1-1
+- 947639 - make Proxy timeouts configurable
+- Bumping package versions for 1.9
+- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
+
* Thu Feb 28 2013 Jan Pazdziora 1.9.8-1
- Removing the dsn parameter from initDB, removing support for --db option.
diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy
index e206dd4..b962888 100644
--- a/rel-eng/packages/spacewalk-proxy
+++ b/rel-eng/packages/spacewalk-proxy
@@ -1 +1 @@
-1.9.8-1 proxy/proxy/
+1.10.1-1 proxy/proxy/
commit cf9909eb2d48d7090a01e0044107908bed32c5d4
Author: Stephen Herr <sherr(a)redhat.com>
Date: Tue Apr 2 18:42:57 2013 -0400
Automatic commit of package [rhnlib] release [2.5.56-1].
diff --git a/client/rhel/rhnlib/rhnlib.spec b/client/rhel/rhnlib/rhnlib.spec
index 5e6ab5d..1cbbab2 100644
--- a/client/rhel/rhnlib/rhnlib.spec
+++ b/client/rhel/rhnlib/rhnlib.spec
@@ -4,7 +4,7 @@ Summary: Python libraries for the RHN project
Name: rhnlib
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 2.5.55
+Version: 2.5.56
Release: 1%{?dist}
Group: Development/Libraries
@@ -60,6 +60,10 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%changelog
+* Tue Apr 02 2013 Stephen Herr <sherr(a)redhat.com> 2.5.56-1
+- 947639 - make Proxy timeouts configurable
+- Purging %%changelog entries preceding Spacewalk 1.0, in active packages.
+
* Tue Oct 30 2012 Jan Pazdziora 2.5.55-1
- Update the copyright year.
diff --git a/rel-eng/packages/rhnlib b/rel-eng/packages/rhnlib
index 5c5ff53..1482bf2 100644
--- a/rel-eng/packages/rhnlib
+++ b/rel-eng/packages/rhnlib
@@ -1 +1 @@
-2.5.55-1 client/rhel/rhnlib/
+2.5.56-1 client/rhel/rhnlib/
commit 7e713aa5c3a853ff1703faad2b59768ab399713f
Author: Stephen Herr <sherr(a)redhat.com>
Date: Tue Apr 2 18:42:01 2013 -0400
947639 - make Proxy timeouts configurable
diff --git a/client/rhel/rhnlib/rhn/connections.py
b/client/rhel/rhnlib/rhn/connections.py
index cd9c0bb..034fccb 100644
--- a/client/rhel/rhnlib/rhn/connections.py
+++ b/client/rhel/rhnlib/rhn/connections.py
@@ -29,9 +29,9 @@ class HTTPResponse(httplib.HTTPResponse):
class HTTPConnection(httplib.HTTPConnection):
response_class = HTTPResponse
- def __init__(self, host, port=None):
+ def __init__(self, host, port=None, timeout=SSL.DEFAULT_TIMEOUT):
if python_version() >= '2.6.1':
- httplib.HTTPConnection.__init__(self, host, port,
timeout=SSL.DEFAULT_TIMEOUT)
+ httplib.HTTPConnection.__init__(self, host, port, timeout=timeout)
else:
httplib.HTTPConnection.__init__(self, host, port)
self._cb_rs = []
@@ -40,6 +40,7 @@ class HTTPConnection(httplib.HTTPConnection):
self._cb_user_data = None
self._cb_callback = None
self._user_agent = "rhn.connections $Revision$ (python)"
+ self.timeout = timeout
def set_callback(self, rs, ws, ex, user_data, callback):
# XXX check the params
@@ -105,9 +106,10 @@ class HTTPConnection(httplib.HTTPConnection):
class HTTPProxyConnection(HTTPConnection):
- def __init__(self, proxy, host, port=None, username=None, password=None):
+ def __init__(self, proxy, host, port=None, username=None, password=None,
+ timeout=SSL.DEFAULT_TIMEOUT):
# The connection goes through the proxy
- HTTPConnection.__init__(self, proxy)
+ HTTPConnection.__init__(self, proxy, timeout=timeout)
# save the proxy values
self.__proxy, self.__proxy_port = self.host, self.port
# self.host and self.port will point to the real host
@@ -148,8 +150,9 @@ class HTTPSConnection(HTTPConnection):
response_class = HTTPResponse
default_port = httplib.HTTPSConnection.default_port
- def __init__(self, host, port=None, trusted_certs=None):
- HTTPConnection.__init__(self, host, port)
+ def __init__(self, host, port=None, trusted_certs=None,
+ timeout=SSL.DEFAULT_TIMEOUT):
+ HTTPConnection.__init__(self, host, port, timeout=timeout)
trusted_certs = trusted_certs or []
self.trusted_certs = trusted_certs
@@ -166,7 +169,7 @@ class HTTPSConnection(HTTPConnection):
sock = None
continue
- sock.settimeout(SSL.DEFAULT_TIMEOUT)
+ sock.settimeout(self.timeout)
try:
sock.connect((self.host, self.port))
@@ -191,8 +194,9 @@ class HTTPSProxyConnection(HTTPProxyConnection):
default_port = HTTPSConnection.default_port
def __init__(self, proxy, host, port=None, username=None, password=None,
- trusted_certs=None):
- HTTPProxyConnection.__init__(self, proxy, host, port, username, password)
+ trusted_certs=None, timeout=SSL.DEFAULT_TIMEOUT):
+ HTTPProxyConnection.__init__(self, proxy, host, port, username,
+ password, timeout=timeout)
trusted_certs = trusted_certs or []
self.trusted_certs = trusted_certs
@@ -221,7 +225,7 @@ class HTTPSProxyConnection(HTTPProxyConnection):
self.close()
raise xmlrpclib.ProtocolError(host,
response.status, response.reason, response.msg)
- self.sock.settimeout(SSL.DEFAULT_TIMEOUT)
+ self.sock.settimeout(self.timeout)
self.sock = SSL.SSLSocket(self.sock, self.trusted_certs)
self.sock.init_ssl()
diff --git a/proxy/proxy/apacheHandler.py b/proxy/proxy/apacheHandler.py
index 9664b01..0332ae8 100644
--- a/proxy/proxy/apacheHandler.py
+++ b/proxy/proxy/apacheHandler.py
@@ -322,6 +322,9 @@ class apacheHandler(rhnApache):
params = { 'host' : host,
'port' : port }
+ if CFG.has_key('timeout'):
+ params['timeout'] = CFG.TIMEOUT
+
if scheme == SCHEME_HTTPS:
conn_class = connections.HTTPSConnection
else:
diff --git a/proxy/proxy/redirect/rhnRedirect.py b/proxy/proxy/redirect/rhnRedirect.py
index a03256f..7f73fd8 100644
--- a/proxy/proxy/redirect/rhnRedirect.py
+++ b/proxy/proxy/redirect/rhnRedirect.py
@@ -291,13 +291,19 @@ class RedirectHandler(SharedHandler):
# Now create a new connection. We'll use SSL if configured to do
# so.
+ params = {
+ 'host' : host,
+ 'port' : port,
+ }
+ if CFG.has_key('timeout'):
+ params['timeout'] = CFG.TIMEOUT
if CFG.USE_SSL:
log_debug(1, " Redirecting with SSL. Cert= ", self.caChain)
- connection = \
- connections.HTTPSConnection(host, port, [self.caChain])
+ params['trusted_certs'] = [self.caChain]
+ connection = connections.HTTPSConnection(**params)
else:
log_debug(1, " Redirecting withOUT SSL.")
- connection = connections.HTTPConnection(host, port)
+ connection = connections.HTTPConnection(**params)
# Put the connection into the current response context.
self.responseContext.setConnection(connection)
diff --git a/proxy/proxy/rhn-conf/rhn_proxy.conf b/proxy/proxy/rhn-conf/rhn_proxy.conf
index 5fb95a3..1617532 100644
--- a/proxy/proxy/rhn-conf/rhn_proxy.conf
+++ b/proxy/proxy/rhn-conf/rhn_proxy.conf
@@ -21,3 +21,4 @@ http_proxy_password =
pkg_dir = /var/spool/rhn-proxy
+timeout = 120
diff --git a/proxy/proxy/rhnShared.py b/proxy/proxy/rhnShared.py
index 0789707..c44fad8 100644
--- a/proxy/proxy/rhnShared.py
+++ b/proxy/proxy/rhnShared.py
@@ -148,6 +148,8 @@ class SharedHandler:
'host' : host,
'port' : port,
}
+ if CFG.has_key('timeout'):
+ params['timeout'] = CFG.TIMEOUT
if self.httpProxy:
params['proxy'] = self.httpProxy
params['username'] = self.httpProxyUsername
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index a2d971e..064e907 100644
--- a/proxy/proxy/spacewalk-proxy.spec
+++ b/proxy/proxy/spacewalk-proxy.spec
@@ -139,7 +139,7 @@ Spacewalk Proxy components.
Summary: Custom Channel Package Manager for the Spacewalk Proxy Server
Group: Applications/Internet
Requires: spacewalk-backend >= 1.7.24
-Requires: rhnlib
+Requires: rhnlib >= 2.5.56
Requires: python
Requires: rhnpush
BuildRequires: /usr/bin/docbook2man