Changes to 'refs/tags/spacewalk-backend-1.4.24-1'
by Miroslav Suchý
Tag 'spacewalk-backend-1.4.24-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-03-30 12:30 +0000
Tagging package [spacewalk-backend] version [1.4.24-1] in directory [backend/].
Changes since osad-5.10.6-1:
Milan Zazrivec (1):
691837 - default to RHN Classic in firstboot
Miroslav Suchý (31):
683200 - convert db-host from IDN to ascii
683200 - spacewalk-create-channel - convert servername from input to Pune encodings
683200 - rhnpush.py - convert servername from input to Pune encodings
683200 - client/solaris - when making profile name from hostname, convert it from Pune encoding
683200 - client/rhn-client-tools - when making profile name from hostname, convert it from Pune encoding
683200 - when sending Traceback, convert hostname from Pune to Unicode
683200 - when reading hostname from config or command line, convert it to Pune encoding
683200 - since email may be in Unicode we could not use cStringIO and we should set content type to utf-8
683200 - cStringIO could not handle Unicode
683200 - refactor rhnMail to use python smtplib
683200 - instead of encodings.idna use wrapper from rhn.connections, which workaround corner cases
683200 - use pune encoding when connecting to jabber
683200 - read and write values from config as utf-8 strings
newt can not accept unicode, see bz 689448
variable can be also unicode, or even child of string or unicode
always return RPC data in plain string (utf-8 encoded)
utilize config.getServerlURL()
create setServerURL() function
utilize function config.setServerURL()
683200 - convert serverURL to Pune encoding
683200 - convert proxy to Pune encoding
683200 - utilizie config.getProxySetting()
683200 - no need to wipe protocol from proxy, return value from config.getProxySetting will never contain it
683200 - convert proxy hostname to Pune
683200 - hostname should not be unicode, most functions expect pure string
683200 - convert IDN hostname in webUI from Pune encoding
683200 - implement convert_url_from_pune()
683200 - convert urls from pune encoding
Automatic commit of package [yum-rhn-plugin] release [1.4.7-1].
Automatic commit of package [spacewalk-setup] release [1.4.3-1].
Automatic commit of package [spacewalk-backend] release [1.4.24-1].
---
backend/common/rhnMail.py | 47 --
backend/common/rhnTB.py | 12
backend/satellite_tools/rhn_satellite_activate.py | 5
backend/satellite_tools/satsync.py | 9
backend/satellite_tools/syncLib.py | 2
backend/server/apacheRequest.py | 1
backend/server/handlers/sat/auth.py | 5
backend/spacewalk-backend.spec | 10
client/debian/apt-spacewalk/src/pre_invoke.py | 3
client/debian/apt-spacewalk/src/spacewalk | 2
client/rhel/rhn-client-tools/data/rh_register.glade | 2
client/rhel/rhn-client-tools/rhn-client-tools.spec | 2
client/rhel/rhn-client-tools/src/bin/rhn_check.py | 1
client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py | 3
client/rhel/rhn-client-tools/src/up2date_client/config.py | 40 +
client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py | 2
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 8
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 2
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 222 +++++-----
client/rhel/rhn-client-tools/test/testConfig.py | 2
client/rhel/yum-rhn-plugin/rhnplugin.py | 10
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5
client/solaris/rhnclient/rhnclient.spec | 3
client/solaris/rhnclient/rhnreg_ks.py | 3
client/tools/action-rpms/rhn-applet-actions/rhn_applet.py | 6
client/tools/osad/src/osa_dispatcher.py | 3
client/tools/osad/src/osad.py | 8
client/tools/rhnpush/rhnpush.py | 6
client/tools/rhnpush/rhnpush.spec | 2
client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel | 4
client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec | 1
java/code/src/com/redhat/rhn/domain/server/Server.java | 10
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 2
java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp | 2
rel-eng/packages/spacewalk-backend | 2
rel-eng/packages/spacewalk-setup | 2
rel-eng/packages/yum-rhn-plugin | 2
satellite/install/install.pl | 3
spacewalk/setup/bin/spacewalk-setup | 4
spacewalk/setup/lib/Spacewalk/Setup.pm | 4
spacewalk/setup/spacewalk-setup.spec | 5
41 files changed, 252 insertions(+), 215 deletions(-)
---
12 years, 8 months
Changes to 'refs/tags/rhn-client-tools-1.4.9-1'
by Miroslav Suchý
Tag 'rhn-client-tools-1.4.9-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-03-30 12:32 +0000
Tagging package [rhn-client-tools] version [1.4.9-1] in directory [client/rhel/rhn-client-tools/].
Changes since osad-5.10.6-1:
Milan Zazrivec (1):
691837 - default to RHN Classic in firstboot
Miroslav Suchý (32):
683200 - convert db-host from IDN to ascii
683200 - spacewalk-create-channel - convert servername from input to Pune encodings
683200 - rhnpush.py - convert servername from input to Pune encodings
683200 - client/solaris - when making profile name from hostname, convert it from Pune encoding
683200 - client/rhn-client-tools - when making profile name from hostname, convert it from Pune encoding
683200 - when sending Traceback, convert hostname from Pune to Unicode
683200 - when reading hostname from config or command line, convert it to Pune encoding
683200 - since email may be in Unicode we could not use cStringIO and we should set content type to utf-8
683200 - cStringIO could not handle Unicode
683200 - refactor rhnMail to use python smtplib
683200 - instead of encodings.idna use wrapper from rhn.connections, which workaround corner cases
683200 - use pune encoding when connecting to jabber
683200 - read and write values from config as utf-8 strings
newt can not accept unicode, see bz 689448
variable can be also unicode, or even child of string or unicode
always return RPC data in plain string (utf-8 encoded)
utilize config.getServerlURL()
create setServerURL() function
utilize function config.setServerURL()
683200 - convert serverURL to Pune encoding
683200 - convert proxy to Pune encoding
683200 - utilizie config.getProxySetting()
683200 - no need to wipe protocol from proxy, return value from config.getProxySetting will never contain it
683200 - convert proxy hostname to Pune
683200 - hostname should not be unicode, most functions expect pure string
683200 - convert IDN hostname in webUI from Pune encoding
683200 - implement convert_url_from_pune()
683200 - convert urls from pune encoding
Automatic commit of package [yum-rhn-plugin] release [1.4.7-1].
Automatic commit of package [spacewalk-setup] release [1.4.3-1].
Automatic commit of package [spacewalk-backend] release [1.4.24-1].
Automatic commit of package [rhn-client-tools] release [1.4.9-1].
---
backend/common/rhnMail.py | 47 --
backend/common/rhnTB.py | 12
backend/satellite_tools/rhn_satellite_activate.py | 5
backend/satellite_tools/satsync.py | 9
backend/satellite_tools/syncLib.py | 2
backend/server/apacheRequest.py | 1
backend/server/handlers/sat/auth.py | 5
backend/spacewalk-backend.spec | 10
client/debian/apt-spacewalk/src/pre_invoke.py | 3
client/debian/apt-spacewalk/src/spacewalk | 2
client/rhel/rhn-client-tools/data/rh_register.glade | 2
client/rhel/rhn-client-tools/rhn-client-tools.spec | 8
client/rhel/rhn-client-tools/src/bin/rhn_check.py | 1
client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py | 3
client/rhel/rhn-client-tools/src/up2date_client/config.py | 40 +
client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py | 2
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 8
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 2
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 222 +++++-----
client/rhel/rhn-client-tools/test/testConfig.py | 2
client/rhel/yum-rhn-plugin/rhnplugin.py | 10
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5
client/solaris/rhnclient/rhnclient.spec | 3
client/solaris/rhnclient/rhnreg_ks.py | 3
client/tools/action-rpms/rhn-applet-actions/rhn_applet.py | 6
client/tools/osad/src/osa_dispatcher.py | 3
client/tools/osad/src/osad.py | 8
client/tools/rhnpush/rhnpush.py | 6
client/tools/rhnpush/rhnpush.spec | 2
client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel | 4
client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec | 1
java/code/src/com/redhat/rhn/domain/server/Server.java | 10
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 2
java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp | 2
rel-eng/packages/rhn-client-tools | 2
rel-eng/packages/spacewalk-backend | 2
rel-eng/packages/spacewalk-setup | 2
rel-eng/packages/yum-rhn-plugin | 2
satellite/install/install.pl | 3
spacewalk/setup/bin/spacewalk-setup | 4
spacewalk/setup/lib/Spacewalk/Setup.pm | 4
spacewalk/setup/spacewalk-setup.spec | 5
42 files changed, 258 insertions(+), 217 deletions(-)
---
12 years, 8 months
client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 6 +++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit d6d485c8709756bdc3e1acc7b5b65b4c69b983bd
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 30 14:32:08 2011 +0200
Automatic commit of package [rhn-client-tools] release [1.4.9-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index db03e71..ba49218 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/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.4.8
+Version: 1.4.9
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -292,6 +292,10 @@ make -f Makefile.rhn-client-tools test
%endif
%changelog
+* Wed Mar 30 2011 Miroslav Suchý 1.4.9-1
+- 683200 - support IDN
+- 691837 - default to RHN Classic in firstboot (mzazrivec(a)redhat.com)
+
* Thu Mar 24 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.4.8-1
- utilize config.getServerlURL()
- atomic save of /etc/sysconfig/rhn/up2date
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 9d5766d..fce903f 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.4.8-1 client/rhel/rhn-client-tools/
+1.4.9-1 client/rhel/rhn-client-tools/
12 years, 8 months
3 commits - backend/spacewalk-backend.spec client/rhel rel-eng/packages spacewalk/setup
by Miroslav Suchý
backend/spacewalk-backend.spec | 6 +++++-
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
rel-eng/packages/spacewalk-setup | 2 +-
rel-eng/packages/yum-rhn-plugin | 2 +-
spacewalk/setup/spacewalk-setup.spec | 5 ++++-
6 files changed, 16 insertions(+), 6 deletions(-)
New commits:
commit 9afdacc19e6b15ca8b47e3781e694074e1f63e37
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 30 14:30:56 2011 +0200
Automatic commit of package [spacewalk-backend] release [1.4.24-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 5df793a..e4949e3 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -11,7 +11,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2 and Python
-Version: 1.4.23
+Version: 1.4.24
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -684,6 +684,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Wed Mar 30 2011 Miroslav Suchý 1.4.24-1
+- always return RPC data in plain string (utf-8 encoded) (msuchy(a)redhat.com)
+- 683200 - support IDN
+
* Wed Mar 30 2011 Jan Pazdziora 1.4.23-1
- 688626 - export md5 attribute also for objects without a checksum
(mzazrivec(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index dd3c805..0ef36ce 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.4.23-1 backend/
+1.4.24-1 backend/
commit ab1e05a6d496f7bba1e4e36c271498d945a11426
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 30 14:27:50 2011 +0200
Automatic commit of package [spacewalk-setup] release [1.4.3-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index e57b369..2280a5f 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-1.4.2-1 spacewalk/setup/
+1.4.3-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 1dffb76..389e81a 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,5 +1,5 @@
Name: spacewalk-setup
-Version: 1.4.2
+Version: 1.4.3
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -101,6 +101,9 @@ rm -rf %{buildroot}
%attr(755, apache, root) %{_var}/spacewalk
%changelog
+* Wed Mar 30 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.4.3-1
+- 683200 - convert db-host from IDN to ascii
+
* Mon Mar 07 2011 Jan Pazdziora 1.4.2-1
- Removing rhn-enable-push.pl as it is not referenced from anywhere.
- Removing rhn-load-config.pl as it is not referenced from anywhere.
commit a8ba5f9f6476f86eb60b6d8af42d092221d86ef2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 30 14:26:43 2011 +0200
Automatic commit of package [yum-rhn-plugin] release [1.4.7-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 4972970..ebd3d33 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.4.6
+Version: 1.4.7
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -72,6 +72,9 @@ fi
%doc LICENSE
%changelog
+* Wed Mar 30 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.4.7-1
+- 683200 - support IDN
+
* Thu Mar 24 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.4.6-1
- 688870 - also check whether cached repo is valid
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index 607bd02..b5bfbae 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-1.4.6-1 client/rhel/yum-rhn-plugin/
+1.4.7-1 client/rhel/yum-rhn-plugin/
12 years, 8 months
28 commits - backend/common backend/satellite_tools backend/server backend/spacewalk-backend.spec client/debian client/rhel client/solaris client/tools java/code satellite/install spacewalk/setup
by Miroslav Suchý
backend/common/rhnMail.py | 47 --
backend/common/rhnTB.py | 12
backend/satellite_tools/rhn_satellite_activate.py | 5
backend/satellite_tools/satsync.py | 9
backend/satellite_tools/syncLib.py | 2
backend/server/apacheRequest.py | 1
backend/server/handlers/sat/auth.py | 5
backend/spacewalk-backend.spec | 4
client/debian/apt-spacewalk/src/pre_invoke.py | 3
client/debian/apt-spacewalk/src/spacewalk | 2
client/rhel/rhn-client-tools/rhn-client-tools.spec | 2
client/rhel/rhn-client-tools/src/bin/rhn_check.py | 1
client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py | 3
client/rhel/rhn-client-tools/src/up2date_client/config.py | 40 +
client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py | 2
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 8
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 2
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 222 +++++-----
client/rhel/rhn-client-tools/test/testConfig.py | 2
client/rhel/yum-rhn-plugin/rhnplugin.py | 10
client/solaris/rhnclient/rhnclient.spec | 3
client/solaris/rhnclient/rhnreg_ks.py | 3
client/tools/action-rpms/rhn-applet-actions/rhn_applet.py | 6
client/tools/osad/src/osa_dispatcher.py | 3
client/tools/osad/src/osad.py | 8
client/tools/rhnpush/rhnpush.py | 6
client/tools/rhnpush/rhnpush.spec | 2
client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel | 4
client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec | 1
java/code/src/com/redhat/rhn/domain/server/Server.java | 10
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 2
java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp | 2
satellite/install/install.pl | 3
spacewalk/setup/bin/spacewalk-setup | 4
spacewalk/setup/lib/Spacewalk/Setup.pm | 4
35 files changed, 235 insertions(+), 208 deletions(-)
New commits:
commit 382a5dbbcbe78cc334d3b2d167e86e1cb292e45d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 29 14:37:04 2011 +0200
683200 - convert urls from pune encoding
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index 5f7e201..09181f2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -14,7 +14,7 @@ up2date agent to hold config info.
import os
import sys
from urlparse import urlsplit, urlunsplit
-from rhn.connections import idn_ascii_to_pune
+from rhn.connections import idn_ascii_to_pune, idn_pune_to_unicode
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index ba55fc4..97c713a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -31,6 +31,7 @@ import up2dateUtils
import rpmUtils
import up2dateLog
import config
+from config import convert_url_from_pune
import up2dateAuth
from rhn import rpclib
from rhn.connections import idn_pune_to_unicode
@@ -123,7 +124,7 @@ class AlreadyRegisteredWindow:
tb = snack.Textbox(size[0]-30, size[1]-20,
(SYSTEM_ALREADY_REGISTERED + "\n\n"
- + _("Red Hat Network Location:") + " " + self.tui.serverURL + "\n"
+ + _("Red Hat Network Location:") + " " + convert_url_from_pune(self.tui.serverURL) + "\n"
+ _("Login:") + " " + oldUsername + "\n"
+ _("System ID:") + " " + oldsystemId + "\n\n"
+ SYSTEM_ALREADY_REGISTERED_CONT + "\n").encode('utf-8'),
@@ -195,7 +196,7 @@ class ConnectWindow:
self.tui = tui
size = snack._snack.size()
- self.server = self.tui.serverURL
+ self.server = convert_url_from_pune(self.tui.serverURL)
fixed_server_url = rhnreg.makeNiceServerUrl(self.server)
@@ -341,7 +342,11 @@ class InfoWindow:
# Satellite
if self.tui.serverType == 'satellite':
- login_prompt = LOGIN_PROMPT % self.server
+ decoded_server = convert_url_from_pune(self.server)
+ url = self.server
+ if decoded_server != self.server:
+ url += " (%s)" % decoded_server
+ login_prompt = LOGIN_PROMPT % url
login_label = LOGIN
login_tip = LOGIN_TIP
commit b27ffb2d9a1a9f1e3e169577765d0ddd7fbe5aad
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 29 14:05:34 2011 +0200
683200 - implement convert_url_from_pune()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index d25f5a0..5f7e201 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -293,6 +293,11 @@ def convert_url_to_pune(url):
s = urlsplit(url)
return urlunsplit([s.scheme, idn_ascii_to_pune(s.netloc), s.path, s.query, s.fragment]).encode('utf-8')
+def convert_url_from_pune(url):
+ """ returns url where hostname is converted from Pune encoding. Returns unicode string. """
+ s = urlsplit(url)
+ return urlunsplit([s.scheme, idn_pune_to_unicode(s.netloc), s.path, s.query, s.fragment])
+
def getServerlURL():
""" return list of serverURL from config
Note: in config may be one value or more values, but this
commit d3bf18726d0117f44214b2914a3e71693edac0c3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 29 14:02:00 2011 +0200
683200 - convert IDN hostname in webUI from Pune encoding
diff --git a/java/code/src/com/redhat/rhn/domain/server/Server.java b/java/code/src/com/redhat/rhn/domain/server/Server.java
index 55e2d78..a9507c8 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Server.java
+++ b/java/code/src/com/redhat/rhn/domain/server/Server.java
@@ -44,6 +44,7 @@ import org.apache.log4j.Logger;
import org.cobbler.CobblerConnection;
import org.cobbler.SystemRecord;
+import java.net.IDN;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Collections;
@@ -945,6 +946,15 @@ public class Server extends BaseDomainHelper implements Identifiable {
}
/**
+ * Get the primary hostname for this server
+ * If hostname is IDN, it is decoded from Pune encoding
+ * @return Returns the primary hostname for this server
+ */
+ public String getDecodedHostname() {
+ return IDN.toUnicode(getHostname());
+ }
+
+ /**
* @return Returns the networkInterfaces.
*/
public Set<NetworkInterface> getNetworkInterfaces() {
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
index d377a49..e28c98e 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
@@ -129,7 +129,7 @@ public class SystemHardwareAction extends RhnAction {
request.setAttribute("dmi_board", server.getDmi().getBoard());
}
- request.setAttribute("network_hostname", server.getHostname());
+ request.setAttribute("network_hostname", server.getDecodedHostname());
request.setAttribute("network_ip_addr", server.getIpAddress());
List<String> nicList = new ArrayList();
diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp b/java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp
index 80d37cc..1bf2471 100644
--- a/java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/sdc/overview.jsp
@@ -89,7 +89,7 @@
<bean:message key="sdc.details.overview.unknown"/>
</c:when>
<c:otherwise>
- <c:out value="${system.hostname}" />
+ <c:out value="${system.decodedHostname}" />
</c:otherwise>
</c:choose>
</td>
commit 87fd5f056eb6828fcb5c6888b067542191722c7a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 16:51:59 2011 +0100
683200 - hostname should not be unicode, most functions expect pure string
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index 93cac9b..d25f5a0 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -291,7 +291,7 @@ def getProxySetting():
def convert_url_to_pune(url):
""" returns url where hostname is converted to Pune encoding """
s = urlsplit(url)
- return urlunsplit([s.scheme, idn_ascii_to_pune(s.netloc), s.path, s.query, s.fragment])
+ return urlunsplit([s.scheme, idn_ascii_to_pune(s.netloc), s.path, s.query, s.fragment]).encode('utf-8')
def getServerlURL():
""" return list of serverURL from config
commit 8968f4370dc4db8eda9288017d38e568e2310279
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 16:32:47 2011 +0100
683200 - convert proxy hostname to Pune
diff --git a/satellite/install/install.pl b/satellite/install/install.pl
index 314f931..b1c0d5d 100755
--- a/satellite/install/install.pl
+++ b/satellite/install/install.pl
@@ -4,6 +4,7 @@ use strict;
use warnings;
use English;
+use Net::LibIDN;
use Pod::Usage;
use Sys::Hostname;
@@ -363,7 +364,7 @@ Import values to be used by Satellite [y/n]",
if ($answers->{'rhn-http-proxy'}) {
$answers->{'rhn-http-proxy'} =~ /^([^:\/]*)(:\d+)?/;
- my ($host, $port) = ($1, $2);
+ my ($host, $port) = (Net::LibIDN::idn_to_ascii($1), $2);
ask(-question => "HTTP Proxy Port",
-test => qr/\d+/,
commit 15fc250c6405b1d53f86d03f1b6842f1428b6251
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 16:08:28 2011 +0100
683200 - no need to wipe protocol from proxy, return value from config.getProxySetting will never contain it
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 38cdbad..8a9c113 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -577,12 +577,6 @@ def get_proxy_url(up2date_cfg):
netloc = config.getProxySetting()
if netloc == '':
raise BadProxyConfig
-
- # Check if a protocol is supplied. We'll ignore it.
- proto_split = netloc.split('://')
- if len(proto_split) > 1:
- netloc = proto_split[1]
-
return proxy_url + netloc
commit 1a43f8b4d0abc0315def2740c87fb1a848d7413d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 16:06:55 2011 +0100
683200 - utilizie config.getProxySetting()
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 856847e..38cdbad 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -574,7 +574,7 @@ def get_proxy_url(up2date_cfg):
proxy_url = proxy_url + urllib.quote(up2date_cfg['proxyPassword'])
proxy_url = proxy_url + '@'
- netloc = up2date_cfg['httpProxy']
+ netloc = config.getProxySetting()
if netloc == '':
raise BadProxyConfig
commit 6e0ea3afeb9ab6ec0fab68797aa84b803df70781
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 15:58:09 2011 +0100
683200 - convert proxy to Pune encoding
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index ceda31a..93cac9b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -272,15 +272,19 @@ class Config:
def getProxySetting():
+ """ returns proxy string in format hostname:port
+ hostname is converted to Pune encoding if needed
+ """
cfg = initUp2dateConfig()
proxy = None
proxyHost = cfg["httpProxy"]
if proxyHost:
if proxyHost[:7] == "http://":
- proxy = proxyHost[7:]
- else:
- proxy = proxyHost
+ proxyHost = proxyHost[7:]
+ parts = proxyHost.split(':')
+ parts[0] = idn_ascii_to_pune(parts[0])
+ proxy = ':'.join(parts)
return proxy
commit b66e2b2f1090d6e01ac8eab2aad814f72dbf3c02
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 15:39:35 2011 +0100
683200 - convert serverURL to Pune encoding
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index 96b3b29..ceda31a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -13,6 +13,8 @@ up2date agent to hold config info.
import os
import sys
+from urlparse import urlsplit, urlunsplit
+from rhn.connections import idn_ascii_to_pune
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
@@ -282,6 +284,11 @@ def getProxySetting():
return proxy
+def convert_url_to_pune(url):
+ """ returns url where hostname is converted to Pune encoding """
+ s = urlsplit(url)
+ return urlunsplit([s.scheme, idn_ascii_to_pune(s.netloc), s.path, s.query, s.fragment])
+
def getServerlURL():
""" return list of serverURL from config
Note: in config may be one value or more values, but this
@@ -291,9 +298,9 @@ def getServerlURL():
# serverURL may be a list in the config file, so by default, grab the
# first element.
if type(cfg['serverURL']) == type([]):
- return cfg['serverURL']
+ return map(convert_url_to_pune, cfg['serverURL'])
else:
- return [cfg['serverURL']]
+ return [convert_url_to_pune(cfg['serverURL'])]
def setServerURL(serverURL):
""" Set serverURL in config """
commit 4a659dab3bc6570e390c6ba2eb5e3a1f11a01cf7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 15:05:17 2011 +0100
utilize function config.setServerURL()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index ea85430..8266f8c 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -286,8 +286,7 @@ class ChooseServerPage:
global serverType
up2dateConfig = config.initUp2dateConfig()
if self.hostedButton.get_active():
- up2dateConfig.set('serverURL',
- 'https://xmlrpc.rhn.redhat.com/XMLRPC')
+ config.setServerURL('https://xmlrpc.rhn.redhat.com/XMLRPC')
if not cfg['sslCACert']:
up2dateConfig.set('sslCACert', '/usr/share/rhn/RHNS-CA-CERT')
else:
@@ -301,7 +300,7 @@ class ChooseServerPage:
# If they changed the value, write it back to the config file.
if customServer != self.server:
- up2dateConfig.set('serverURL', customServer)
+ config.setServerURL(customServer)
if not cfg['sslCACert']:
up2dateConfig.set('sslCACert',
'/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT')
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index 38ef92b..ba55fc4 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -202,7 +202,7 @@ class ConnectWindow:
#Save the config only if the url is different
if fixed_server_url != self.server:
self.server = fixed_server_url
- cfg.set('serverURL', self.server)
+ config.setServerURL(self.server)
cfg.save()
commit 321d737473d1e8f588474fd65f34f8f5f0f99fe7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 25 13:48:47 2011 +0100
create setServerURL() function
initialy this is dump
we will add more logic later
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index b18c584..96b3b29 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -295,6 +295,12 @@ def getServerlURL():
else:
return [cfg['serverURL']]
+def setServerURL(serverURL):
+ """ Set serverURL in config """
+ cfg = initUp2dateConfig()
+ cfg.set('serverURL', serverURL)
+
+
def initUp2dateConfig(cfg_file = "/etc/sysconfig/rhn/up2date"):
"""This function is the right way to get at the up2date config."""
global cfg
commit 0bcb72e1860ff17b3b95ccd029f752f927c7cf16
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 24 17:47:50 2011 +0100
utilize config.getServerlURL()
instead of manualy handling list vs. one value in up2dateConfig["serverURL"]
utilize config.getServerlURL() which do that for us
diff --git a/client/debian/apt-spacewalk/src/pre_invoke.py b/client/debian/apt-spacewalk/src/pre_invoke.py
index 2610eba..738cc53 100755
--- a/client/debian/apt-spacewalk/src/pre_invoke.py
+++ b/client/debian/apt-spacewalk/src/pre_invoke.py
@@ -39,8 +39,7 @@ def get_channels():
def get_server():
"""Spacewalk server fqdn"""
- up2date_cfg = config.initUp2dateConfig()
- return urlparse(up2date_cfg['serverURL']).netloc
+ return urlparse(config.getServerlURL()[0]).netloc
def get_conf_file():
"""Path to spacewalk.list configuration file"""
diff --git a/client/debian/apt-spacewalk/src/spacewalk b/client/debian/apt-spacewalk/src/spacewalk
index 5ddd770..7f1e63a 100755
--- a/client/debian/apt-spacewalk/src/spacewalk
+++ b/client/debian/apt-spacewalk/src/spacewalk
@@ -132,7 +132,7 @@ class spacewalk_method(pkg_acquire_method):
def __load_config(self):
if self.up2date_cfg == None:
self.up2date_cfg = config.initUp2dateConfig()
- self.up2date_server = urlparse(self.up2date_cfg['serverURL'])
+ self.up2date_server = urlparse(config.getServerlURL()[0])
# TODO: proxy settings
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
index 2348e14..34b70cf 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnChannel.py
@@ -101,7 +101,7 @@ def getChannels(force=None, label_whitelist=None):
if label_whitelist and not label_whitelist.has_key(chan['label']):
continue
- channel = rhnChannel(type = 'up2date', url = cfg["serverURL"])
+ channel = rhnChannel(type = 'up2date', url = config.getServerlURL())
for key in chan.keys():
if key == "last_modified":
channel['version'] = chan['last_modified']
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index c803bde..856847e 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -245,7 +245,7 @@ class RhnRepo(YumRepository):
if type(channel['url']) == list:
for url in channel['url']:
urls.append(url + '/GET-REQ/' + self.id)
- else:
+ else: # type will be always list since Spacewalk 1.4, in future this will be dead coed
urls.append(channel['url'] + '/GET-REQ/' + self.id)
self.baseurl = urls
diff --git a/client/tools/action-rpms/rhn-applet-actions/rhn_applet.py b/client/tools/action-rpms/rhn-applet-actions/rhn_applet.py
index b132875..555ea95 100755
--- a/client/tools/action-rpms/rhn-applet-actions/rhn_applet.py
+++ b/client/tools/action-rpms/rhn-applet-actions/rhn_applet.py
@@ -105,14 +105,10 @@ def read_cfg_val(obj, key):
return None
def update_applet_cfg():
-
+ server_url = config.getServerlURL()[0]
# get up2date's conf vals...
- server_url = read_cfg_val(cfg, 'serverURL')
new_ca = read_cfg_val(cfg, 'sslCACert')
- if type(server_url) == type([]):
- server_url = server_url[0]
-
# TODO: applet needs to support failover
# for now patch the ca
if type(new_ca) == type([]):
diff --git a/client/tools/osad/src/osad.py b/client/tools/osad/src/osad.py
index cd24654..a0443a5 100644
--- a/client/tools/osad/src/osad.py
+++ b/client/tools/osad/src/osad.py
@@ -253,14 +253,10 @@ class Runner(jabber_lib.Runner):
try:
server_url = osad_config.get('server_url')
except osad_config.InterpolationError, e:
- # Have to read up2date's config files
- c = self.get_up2date_config()
- server_url = c['serverURL']
+ server_url = config.getServerlURL()[0]
else:
if server_url is None:
- # Have to read up2date's config files
- c = self.get_up2date_config()
- server_url = c['serverURL']
+ server_url = config.getServerlURL()[0]
ret['server_url'] = server_url
commit d3fbbbec76e3c983bfd947ba4d6a4a0682508c81
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 24 00:11:19 2011 +0100
always return RPC data in plain string (utf-8 encoded)
If you send over RPC some data, it is returned as string.
But if the data (e.g. systemId) contains some field (e.g. profile name),
which contains non-ascii characters (ord >> 128) then data are
returned as unicode.
This give trouble to our code (e.g. server/rhnHandler.auth_system()), which
expect plain string to receive from RPC.
diff --git a/backend/server/apacheRequest.py b/backend/server/apacheRequest.py
index a2f288b..d6c461b 100644
--- a/backend/server/apacheRequest.py
+++ b/backend/server/apacheRequest.py
@@ -61,6 +61,7 @@ class apacheRequest:
# Make sure the decoder doesn't assume UTF-8 data, that would break if
# non-UTF-8 chars are sent (bug 139370)
self.decoder._encoding = None
+ self.parser._parser.returns_unicode = 0
# extract the server we're talking to and the root directory
# from the request configuration options
diff --git a/client/rhel/rhn-client-tools/src/bin/rhn_check.py b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
index 5a3d68a..c145df9 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhn_check.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhn_check.py
@@ -190,6 +190,7 @@ class CheckCli(rhncli.RhnCli):
""" Parse action data and returns (method, params) """
data = action['action']
parser, decoder = xmlrpclib.getparser()
+ parser._parser.returns_unicode = 0
parser.feed(data)
parser.close()
params = decoder.close()
commit 18493137991744a597512458af7b65aed13a5e98
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 21 16:54:42 2011 +0100
variable can be also unicode, or even child of string or unicode
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
index 0af9a1c..946d474 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
@@ -113,7 +113,7 @@ def getServer(refreshCallback=None):
# The servers we're talking to need to have their certs
# signed by one of these CA.
ca = cfg["sslCACert"]
- if type(ca) == type(""):
+ if isinstance(ca, basestring):
ca = [ca]
rhns_ca_certs = ca or ["/usr/share/rhn/RHNS-CA-CERT"]
diff --git a/client/rhel/rhn-client-tools/test/testConfig.py b/client/rhel/rhn-client-tools/test/testConfig.py
index a26e633..644799f 100755
--- a/client/rhel/rhn-client-tools/test/testConfig.py
+++ b/client/rhel/rhn-client-tools/test/testConfig.py
@@ -33,7 +33,7 @@ class TestConfig(unittest.TestCase):
def testConfigString(self):
"Verify that Config loads a string as a string"
cfg = config.initUp2dateConfig(test_up2date)
- assert type(cfg['systemIdPath']) == type("")
+ assert isinstance(cfg['systemIdPath'], basestring)
def testConfigListSingleItem(self):
"Verify that Config loads a list of one as a list"
commit 14b806133414d80ed4c95f178de7660fbd4ff35a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 21 16:46:40 2011 +0100
newt can not accept unicode, see bz 689448
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index 461f31f..38ef92b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -41,34 +41,34 @@ log = up2dateLog.initLog()
cfg = config.initUp2dateConfig()
def FatalErrorWindow(screen, errmsg):
- snack.ButtonChoiceWindow(screen, FATAL_ERROR, "%s" % errmsg,
- [OK])
+ snack.ButtonChoiceWindow(screen, FATAL_ERROR.encode('utf-8'), (u"%s" % errmsg).encode('utf-8'),
+ [OK.encode('utf-8')])
screen.finish()
sys.exit(1)
def WarningWindow(screen, errmsg):
- snack.ButtonChoiceWindow(screen, WARNING, "%s" % errmsg,
- [OK])
+ snack.ButtonChoiceWindow(screen, WARNING.encode('utf-8'), ("%s" % errmsg).encode('utf-8'),
+ [OK.encode('utf-8')])
screen.finish()
def ConfirmQuitWindow(screen):
- button = snack.ButtonChoiceWindow(screen, CONFIRM_QUIT,
- CONFIRM_QUIT_SURE + "\n" + \
- WHY_REGISTER_SEC + "\n" + \
- WHY_REGISTER_SEC_TXT + "\n\n" + \
- WHY_REGISTER_DLD + "\n" + \
- WHY_REGISTER_DLD_TXT + "\n\n" + \
- WHY_REGISTER_SUPP + "\n" + \
- WHY_REGISTER_SUPP_TXT + "\n\n" + \
- WHY_REGISTER_COMP + "\n" + \
- WHY_REGISTER_COMP_TXT + "\n\n" + \
- CONFIRM_QUIT_WILLNOT + "\n" + \
- WHY_REGISTER_TIP,
- [CONTINUE_REGISTERING, REGISTER_LATER2],
+ button = snack.ButtonChoiceWindow(screen, CONFIRM_QUIT.encode('utf-8'),
+ CONFIRM_QUIT_SURE.encode('utf-8') + "\n" + \
+ WHY_REGISTER_SEC.encode('utf-8') + "\n" + \
+ WHY_REGISTER_SEC_TXT.encode('utf-8') + "\n\n" + \
+ WHY_REGISTER_DLD.encode('utf-8') + "\n" + \
+ WHY_REGISTER_DLD_TXT.encode('utf-8') + "\n\n" + \
+ WHY_REGISTER_SUPP.encode('utf-8') + "\n" + \
+ WHY_REGISTER_SUPP_TXT.encode('utf-8') + "\n\n" + \
+ WHY_REGISTER_COMP.encode('utf-8') + "\n" + \
+ WHY_REGISTER_COMP_TXT.encode('utf-8') + "\n\n" + \
+ CONFIRM_QUIT_WILLNOT.encode('utf-8') + "\n" + \
+ WHY_REGISTER_TIP.encode('utf-8'),
+ [CONTINUE_REGISTERING.encode('utf-8'), REGISTER_LATER2.encode('utf-8')],
width = 70)
- if button == string.lower(REGISTER_LATER2):
+ if button == string.lower(REGISTER_LATER2.encode('utf-8')):
screen.finish()
return 1
else:
@@ -115,18 +115,18 @@ class AlreadyRegisteredWindow:
oldUsername = systemIdXml[0][0]['username']
oldsystemId = systemIdXml[0][0]['system_id']
- toplevel = snack.GridForm(self.screen, SYSTEM_ALREADY_SETUP, 1, 2)
+ toplevel = snack.GridForm(self.screen, SYSTEM_ALREADY_SETUP.encode('utf-8'), 1, 2)
self.bb = snack.ButtonBar(self.screen,
- [(YES_CONT, "next"),
- (NO_CANCEL, "exit")])
+ [(YES_CONT.encode('utf-8'), "next"),
+ (NO_CANCEL.encode('utf-8'), "exit")])
toplevel.add(self.bb, 0, 1, growx = 1)
tb = snack.Textbox(size[0]-30, size[1]-20,
- SYSTEM_ALREADY_REGISTERED + "\n\n"
+ (SYSTEM_ALREADY_REGISTERED + "\n\n"
+ _("Red Hat Network Location:") + " " + self.tui.serverURL + "\n"
+ _("Login:") + " " + oldUsername + "\n"
+ _("System ID:") + " " + oldsystemId + "\n\n"
- + SYSTEM_ALREADY_REGISTERED_CONT + "\n",
+ + SYSTEM_ALREADY_REGISTERED_CONT + "\n").encode('utf-8'),
1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
@@ -158,16 +158,16 @@ class AlreadyRegisteredSubscriptionManagerWindow:
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(self.screen, SYSTEM_ALREADY_SETUP, 1, 2)
+ toplevel = snack.GridForm(self.screen, SYSTEM_ALREADY_SETUP.encode('utf-8'), 1, 2)
self.bb = snack.ButtonBar(self.screen,
- [(YES_CONT, "next"),
- (NO_CANCEL, "exit")])
+ [(YES_CONT.encode('utf-8'), "next"),
+ (NO_CANCEL.encode('utf-8'), "exit")])
toplevel.add(self.bb, 0, 1, growx = 1)
tb = snack.Textbox(size[0]-30, size[1]-20,
- WARNING + "\n\n"
+ (WARNING + "\n\n"
+ RHSM_SYSTEM_ALREADY_REGISTERED + "\n\n"
- + SYSTEM_ALREADY_REGISTERED_CONT + "\n",
+ + SYSTEM_ALREADY_REGISTERED_CONT + "\n").encode('utf-8'),
1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
@@ -208,7 +208,7 @@ class ConnectWindow:
self.proxy = cfg['httpProxy']
- toplevel = snack.GridForm(self.screen, CONNECT_WINDOW, 1, 1)
+ toplevel = snack.GridForm(self.screen, CONNECT_WINDOW.encode('utf-8'), 1, 1)
text = CONNECT_WINDOW_TEXT % self.server + "\n\n"
@@ -216,7 +216,7 @@ class ConnectWindow:
text += CONNECT_WINDOW_TEXT2 % self.proxy
tb = snack.Textbox(size[0]-30, size[1]-20,
- text,
+ text.encode('utf-8'),
1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
@@ -250,18 +250,18 @@ class StartWindow:
self.screen = screen
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(self.screen, START_REGISTER_WINDOW,
+ toplevel = snack.GridForm(self.screen, START_REGISTER_WINDOW.encode('utf-8'),
1, 2)
- start_register_text = START_REGISTER_TEXT
+ start_register_text = START_REGISTER_TEXT.encode('utf-8')
tb = snack.Textbox(size[0]-10, size[1]-14, start_register_text, 1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
self.bb = snack.ButtonBar(self.screen,
- [(WHY_REGISTER, "why_register"),
- (NEXT, "next"),
- (CANCEL, "cancel")])
+ [(WHY_REGISTER.encode('utf-8'), "why_register"),
+ (NEXT.encode('utf-8'), "next"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 1, growx = 1)
self.g = toplevel
@@ -291,7 +291,7 @@ class WhyRegisterWindow:
self.screen = screen
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(self.screen, WHY_REGISTER_WINDOW,
+ toplevel = snack.GridForm(self.screen, WHY_REGISTER_WINDOW.encode('utf-8'),
1, 2)
@@ -306,13 +306,13 @@ class WhyRegisterWindow:
WHY_REGISTER_COMP_TXT + "\n\n" + \
WHY_REGISTER_TIP
- tb = snack.Textbox(size[0]-10, size[1]-14, why_register_text, 1, 1)
+ tb = snack.Textbox(size[0]-10, size[1]-14, why_register_text.encode('utf-8'), 1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
self.bb = snack.ButtonBar(self.screen,
- [(BACK_REGISTER, "back")])
+ [(BACK_REGISTER.encode('utf-8'), "back")])
toplevel.add(self.bb, 0, 1, growx = 1)
self.g = toplevel
@@ -337,7 +337,7 @@ class InfoWindow:
size = snack._snack.size()
- toplevel = snack.GridForm(screen, REGISTER_WINDOW, 1, 4)
+ toplevel = snack.GridForm(screen, REGISTER_WINDOW.encode('utf-8'), 1, 4)
# Satellite
if self.tui.serverType == 'satellite':
@@ -353,14 +353,14 @@ class InfoWindow:
label = snack.Textbox(size[0]-10, 3,
- login_prompt,
+ login_prompt.encode('utf-8'),
scroll = 0, wrap = 1)
toplevel.add(label, 0, 0, anchorLeft = 1)
grid = snack.Grid(2, 3)
- label = snack.Label(login_label)
+ label = snack.Label(login_label.encode('utf-8'))
grid.setField(label, 0, 0, padding = (0, 0, 1, 0),
anchorRight = 1)
@@ -368,7 +368,7 @@ class InfoWindow:
self.userNameEntry.set(tui.userName)
grid.setField(self.userNameEntry, 1, 0, anchorLeft = 1)
- label = snack.Label(PASSWORD)
+ label = snack.Label(PASSWORD.encode('utf-8'))
grid.setField(label, 0, 1, padding = (0, 0, 1, 0),
anchorRight = 1)
@@ -381,14 +381,14 @@ class InfoWindow:
toplevel.add(grid, 0, 1)
- label = snack.TextboxReflowed(size[0]-10, login_tip)
+ label = snack.TextboxReflowed(size[0]-10, login_tip.encode('utf-8'))
toplevel.add(label, 0, 2, anchorLeft=1)
# BUTTON BAR
self.bb = snack.ButtonBar(screen,
- [(NEXT, "next"),
- (BACK, "back"),
- (CANCEL, "cancel")])
+ [(NEXT.encode('utf-8'), "next"),
+ (BACK.encode('utf-8'), "back"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 3, padding = (0, 1, 0, 0),
growx = 1)
@@ -399,15 +399,15 @@ class InfoWindow:
def validateFields(self):
if self.userNameEntry.value() == "":
- snack.ButtonChoiceWindow(self.screen, ERROR,
- USER_REQUIRED,
- buttons = [OK])
+ snack.ButtonChoiceWindow(self.screen, ERROR.encode('utf-8'),
+ USER_REQUIRED.encode('utf-8'),
+ buttons = [OK.encode('utf-8')])
self.g.setCurrent(self.userNameEntry)
return 0
if self.passwordEntry.value() == "":
- snack.ButtonChoiceWindow(self.screen, ERROR,
- PASSWORD_REQUIRED,
- buttons = [OK])
+ snack.ButtonChoiceWindow(self.screen, ERROR.encode('utf-8'),
+ PASSWORD_REQUIRED.encode('utf-8'),
+ buttons = [OK.encode('utf-8')])
self.g.setCurrent(self.passwordEntry)
return 0
@@ -415,7 +415,7 @@ class InfoWindow:
try:
self.tui.alreadyRegistered = rhnreg.reserveUser(self.userNameEntry.value(), self.passwordEntry.value())
except up2dateErrors.ValidationError, e:
- snack.ButtonChoiceWindow(self.screen, _("Error"), _("The server indicated an error:\n") + e.errmsg, buttons = [_("OK")])
+ snack.ButtonChoiceWindow(self.screen, _("Error").encode('utf-8'), _("The server indicated an error:\n").encode('utf-8') + e.errmsg, buttons = [_("OK").encode('utf-8')])
self.g.setCurrent(self.userNameEntry)
return 0
except up2dateErrors.CommunicationError,e:
@@ -477,12 +477,12 @@ class OSReleaseWindow:
self.selectChannel = False
- toplevel = snack.GridForm(self.screen, SELECT_OSRELEASE, 1, 7)
+ toplevel = snack.GridForm(self.screen, SELECT_OSRELEASE.encode('utf-8'), 1, 7)
self.g = toplevel
- self.ostext = snack.TextboxReflowed(self.size[0]-10, OS_VERSION)
+ self.ostext = snack.TextboxReflowed(self.size[0]-10, OS_VERSION.encode('utf-8'))
toplevel.add(self.ostext, 0, 0, anchorLeft = 1)
- optiontext1 = LIMITED_UPDATES
+ optiontext1 = LIMITED_UPDATES.encode('utf-8')
if self.tui.limited_updates_button:
self.limited_updates_button = snack.SingleRadioButton(optiontext1,
@@ -494,7 +494,7 @@ class OSReleaseWindow:
toplevel.add(self.limited_updates_button, 0, 1, padding = (0, 1, 0, 1),
anchorLeft = 1)
- self.sublabel = snack.Label(MINOR_RELEASE)
+ self.sublabel = snack.Label(MINOR_RELEASE.encode('utf-8'))
toplevel.add(self.sublabel, 0, 2, anchorLeft = 1)
self.channelList = snack.Listbox(self.size[1]-22, 1,
@@ -506,10 +506,10 @@ class OSReleaseWindow:
value = value + "*"
self.channelList.append(" " + value, key)
- self.tip = snack.TextboxReflowed(self.size[0]-10, CHANNEL_PAGE_TIP)
+ self.tip = snack.TextboxReflowed(self.size[0]-10, CHANNEL_PAGE_TIP.encode('utf-8'))
toplevel.add(self.tip, 0, 4, anchorLeft = 1)
- optiontext2 = ALL_UPDATES
+ optiontext2 = ALL_UPDATES.encode('utf-8')
if self.tui.all_updates_button:
self.all_updates_button = snack.SingleRadioButton(optiontext2,
@@ -522,14 +522,14 @@ class OSReleaseWindow:
anchorLeft = 1)
#self.warning = snack.TextboxReflowed(self.size[0]-10,
- # CHANNEL_PAGE_WARNING)
+ # CHANNEL_PAGE_WARNING.encode('utf-8'))
#toplevel.add(self.warning, 0, 9, anchorLeft = 1)
self.bb = snack.ButtonBar(screen,
- [(NEXT, "next"),
- (BACK, "back"),
- (CANCEL, "cancel")])
+ [(NEXT.encode('utf-8'), "next"),
+ (BACK.encode('utf-8'), "back"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 6, growx = 1)
self.screen.refresh()
@@ -562,16 +562,16 @@ class OSReleaseWindow:
later_release = self.channelList.current() != \
self.available_channels['default_channel']
- title = CONFIRM_OS_RELEASE_SELECTION
+ title = CONFIRM_OS_RELEASE_SELECTION.encode('utf-8')
if later_release:
msgbox = snack.ButtonChoiceWindow(self.screen, title,
- CONFIRM_OS_WARNING % self.channelList.current(),
- buttons =[OK, CANCEL])
+ CONFIRM_OS_WARNING.encode('utf-8') % self.channelList.current(),
+ buttons =[OK.encode('utf-8'), CANCEL.encode('utf-8')])
return msgbox
if self.all_updates_button.selected() or later_release:
msgbox = snack.ButtonChoiceWindow(self.screen, title,
- CONFIRM_OS_ALL, buttons =[OK, CANCEL])
+ CONFIRM_OS_ALL.encode('utf-8'), buttons =[OK.encode('utf-8'), CANCEL.encode('utf-8')])
return msgbox
return msgbox
@@ -611,15 +611,15 @@ class HardwareWindow:
# read all hardware in
tui.hardware = hardware.Hardware()
- toplevel = snack.GridForm(screen, HARDWARE_WINDOW, 1, 7)
+ toplevel = snack.GridForm(screen, HARDWARE_WINDOW.encode('utf-8'), 1, 7)
- text = snack.TextboxReflowed(70, HARDWARE_WINDOW_DESC1)
+ text = snack.TextboxReflowed(70, HARDWARE_WINDOW_DESC1.encode('utf-8'))
toplevel.add(text, 0, 0, anchorLeft = 1)
grid = snack.Grid(2, 2)
- label = snack.Label(_("Profile name:"))
+ label = snack.Label(_("Profile name:").encode('utf-8'))
grid.setField(label, 0, 0, padding = (0, 0, 1, 0), anchorRight = 1)
self.profileEntry = snack.Entry(40)
@@ -628,21 +628,21 @@ class HardwareWindow:
toplevel.add(grid, 0, 1, anchorLeft = 1)
if tui.includeHardware:
- self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX, isOn = 1)
+ self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX.encode('utf-8'), isOn = 1)
else:
- self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX)
+ self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX.encode('utf-8'))
toplevel.add(self.hardwareButton, 0, 2, padding = (0, 1, 0, 0),
anchorLeft = 1)
- label = snack.Label(DESELECT)
+ label = snack.Label(DESELECT.encode('utf-8'))
toplevel.add(label, 0, 3, anchorLeft = 1, padding = (0, 0, 0, 1))
grid = snack.Grid(4, 3)
hardware_text = ''
hardware_text += _("Version: ") + up2dateUtils.getVersion() + " "
- self.versionLabel = snack.Label(_("Version: "))
+ self.versionLabel = snack.Label(_("Version: ").encode('utf-8'))
grid.setField(self.versionLabel, 0, 0, padding = (0, 0, 1, 0), anchorLeft = 1)
self.versionLabel2 = snack.Label(up2dateUtils.getVersion())
@@ -664,7 +664,7 @@ class HardwareWindow:
if tui.profileName != "":
self.profileEntry.set(tui.profileName)
else:
- self.profileEntry.set(unicode_hostname)
+ self.profileEntry.set(unicode_hostname.encode('utf-8'))
hardware_text += _("CPU speed: ")
@@ -684,19 +684,19 @@ class HardwareWindow:
if hw['class'] == 'MEMORY':
hardware_text += _("%s megabytes") % hw['ram']
- tb = snack.TextboxReflowed(80, hardware_text)
+ tb = snack.TextboxReflowed(80, hardware_text.encode('utf-8'))
toplevel.add(tb, 0, 4)
- self.additionalHWLabel = snack.TextboxReflowed(size[0]-10, HARDWARE_WINDOW_DESC2)
+ self.additionalHWLabel = snack.TextboxReflowed(size[0]-10, HARDWARE_WINDOW_DESC2.encode('utf-8'))
toplevel.add(self.additionalHWLabel, 0, 5, padding = (0, 1, 0, 0),
anchorLeft = 1)
# BUTTON BAR
self.bb = snack.ButtonBar(screen,
- [(NEXT, "next"),
- (BACK, "back"),
- (CANCEL, "cancel")])
+ [(NEXT.encode('utf-8'), "next"),
+ (BACK.encode('utf-8'), "back"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 6, padding = (0, 1, 0, 0),
growx = 1)
@@ -724,19 +724,19 @@ class PackagesWindow:
self.screen = screen
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(screen, PACKAGES_WINDOW, 1, 5)
+ toplevel = snack.GridForm(screen, PACKAGES_WINDOW.encode('utf-8'), 1, 5)
self.g = toplevel
- text = snack.TextboxReflowed(size[0]-10, PACKAGES_WINDOW_DESC1)
+ text = snack.TextboxReflowed(size[0]-10, PACKAGES_WINDOW_DESC1.encode('utf-8'))
toplevel.add(text, 0, 0, anchorLeft = 1)
- self.packagesButton = snack.Checkbox(PACKAGES_WINDOW_DESC2, 1)
+ self.packagesButton = snack.Checkbox(PACKAGES_WINDOW_DESC2.encode('utf-8'), 1)
toplevel.add(self.packagesButton, 0, 1, padding = (0, 1, 0, 1),
anchorLeft = 1)
- label = snack.Label(PACKAGES_WINDOW_UNCHECK)
+ label = snack.Label(PACKAGES_WINDOW_UNCHECK.encode('utf-8'))
toplevel.add(label, 0, 2, anchorLeft = 1)
#self.packageList = snack.Listbox(size[1]-18, 1, width = size[0]-10)
@@ -745,7 +745,7 @@ class PackagesWindow:
# do we need to read the packages from disk?
if tui.packageList == []:
- self.pwin = snack.GridForm(screen, PACKAGES_WINDOW_PKGLIST, 1, 1)
+ self.pwin = snack.GridForm(screen, PACKAGES_WINDOW_PKGLIST.encode('utf-8'), 1, 1)
self.scale = snack.Scale(40, 100)
self.pwin.add(self.scale, 0, 0)
@@ -766,9 +766,9 @@ class PackagesWindow:
# BUTTON BAR
self.bb = snack.ButtonBar(screen,
- [(NEXT, "next"),
- (BACK, "back"),
- (CANCEL, "cancel")])
+ [(NEXT.encode('utf-8'), "next"),
+ (BACK.encode('utf-8'), "back"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 4, padding = (0, 1, 0, 0),
growx = 1)
@@ -805,16 +805,16 @@ class SendWindow:
self.name = "SendWindow"
size = snack._snack.size()
- toplevel = snack.GridForm(screen, SEND_WINDOW, 1, 2)
+ toplevel = snack.GridForm(screen, SEND_WINDOW.encode('utf-8'), 1, 2)
- text = snack.TextboxReflowed(size[0]-15, SEND_WINDOW_DESC)
+ text = snack.TextboxReflowed(size[0]-15, SEND_WINDOW_DESC.encode('utf-8'))
toplevel.add(text, 0, 0)
# BUTTON BAR
self.bb = snack.ButtonBar(screen,
- [(NEXT, "next"),
- (BACK, "back"),
- (CANCEL, "cancel")])
+ [(NEXT.encode('utf-8'), "next"),
+ (BACK.encode('utf-8'), "back"),
+ (CANCEL.encode('utf-8'), "cancel")])
toplevel.add(self.bb, 0, 1, padding = (0, 1, 0, 0),
growx = 1)
@@ -841,7 +841,7 @@ class SendingWindow:
self.name = "SendingWindow"
size = snack._snack.size()
- self.pwin = snack.GridForm(screen, SENDING_WINDOW, 1, 1)
+ self.pwin = snack.GridForm(screen, SENDING_WINDOW.encode('utf-8'), 1, 1)
self.scale = snack.Scale(40, 100)
self.pwin.add(self.scale, 0, 0)
@@ -996,15 +996,15 @@ class FinishWindow:
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(screen, FINISH_WINDOW,
+ toplevel = snack.GridForm(screen, FINISH_WINDOW.encode('utf-8'),
1, 2)
- text = snack.TextboxReflowed(size[0]-11, FINISH_WINDOW_TEXT_TUI)
+ text = snack.TextboxReflowed(size[0]-11, FINISH_WINDOW_TEXT_TUI.encode('utf-8'))
toplevel.add(text, 0, 0)
# BUTTON BAR
self.bb = snack.ButtonBar(screen,
- [(_("Finish"), "next")])
+ [(_("Finish").encode('utf-8'), "next")])
toplevel.add(self.bb, 0, 1, padding = (0, 1, 0, 0),
growx = 1)
@@ -1032,7 +1032,7 @@ class ReviewWindow:
self.reg_info = tui.reg_info
size = snack._snack.size()
- toplevel = snack.GridForm(screen, REVIEW_WINDOW, 1, 2)
+ toplevel = snack.GridForm(screen, REVIEW_WINDOW.encode('utf-8'), 1, 2)
review_window_text = ''
if not self.tui.yum_plugin_present:
@@ -1091,12 +1091,12 @@ class ReviewWindow:
act_key_list += act_key
review_window_text += ACTIVATION_KEY % (act_key_list)
- self.review_window = snack.Textbox(size[0]-10, size[1]-14, review_window_text, 1, 1)
+ self.review_window = snack.Textbox(size[0]-10, size[1]-14, review_window_text.encode('utf-8'), 1, 1)
toplevel.add(self.review_window, 0, 0, padding = (0, 1, 0, 0))
# BUTTON BAR
- self.bb = snack.ButtonBar(screen, [(OK, "next")])
+ self.bb = snack.ButtonBar(screen, [(OK.encode('utf-8'), "next")])
toplevel.add(self.bb, 0, 1, padding = (0, 1, 0, 0),
growx = 1)
@@ -1163,8 +1163,8 @@ class Tui:
def drawFrame(self):
self.welcomeText = COPYRIGHT_TEXT
- self.screen.drawRootText(0, 0, self.welcomeText)
- self.screen.pushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"))
+ self.screen.drawRootText(0, 0, self.welcomeText.encode('utf-8'))
+ self.screen.pushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen").encode('utf-8'))
def initResults(self):
commit 5b4a3dd0d036aec097cf7f98e51b08844befc0ae
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 21 14:41:12 2011 +0100
683200 - read and write values from config as utf-8 strings
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index 25c6fcd..b18c584 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -87,7 +87,7 @@ class ConfigFile:
# or maybe error.
continue
key = split[0].strip()
- value = split[1].strip()
+ value = unicode(split[1].strip(), 'utf-8')
# decode a comment line
comment = None
@@ -149,11 +149,11 @@ class ConfigFile:
f.write("")
for key in self.dict.keys():
val = self.dict[key]
- f.write("%s[comment]=%s\n" % (key, val[0]))
+ f.write((u"%s[comment]=%s\n" % (key, val[0])).encode('utf-8'))
if type(val[1]) == type([]):
- f.write("%s=%s;\n" % (key, ';'.join(map(str, val[1]))))
+ f.write((u"%s=%s;\n" % (key, ';'.join(map(str, val[1])))).encode('utf-8'))
else:
- f.write("%s=%s\n" % (key, val[1]))
+ f.write((u"%s=%s\n" % (key, val[1])).encode('utf-8'))
f.write("\n")
f.close()
os.rename(self.fileName+'.new', self.fileName)
commit 41337acb55884fa9277e9231e62a78cfa824a73e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 21 14:00:13 2011 +0100
683200 - use pune encoding when connecting to jabber
addressing:
RHN 24912 2011/03/21 13:57:55 +02:00: ('Traceback (most recent call last):\n File "/usr/share/rhn/osad/jabber_lib.py", line 253, in setup_connection\n c = self._get_jabber_client(js)\n File "/usr/share/rhn/osad/jabber_lib.py", line 310, in _get_jabber_client\n c.connect()\n File "/usr/share/rhn/osad/jabber_lib.py", line 567, in connect\n jabber.Client.connect(self)\n File "/usr/lib/python2.4/site-packages/jabber/xmlstream.py", line 466, in connect\n else: self._sock.connect((self._hostIP, self._port))\n File "<string>", line 1, in connect\nerror: (111, \'Connection refused\')\n',)
diff --git a/client/tools/osad/src/osa_dispatcher.py b/client/tools/osad/src/osa_dispatcher.py
index 5d7fa5a..f89099f 100644
--- a/client/tools/osad/src/osa_dispatcher.py
+++ b/client/tools/osad/src/osa_dispatcher.py
@@ -17,6 +17,7 @@ import sys
import select
import socket
import SocketServer
+from rhn.connections import idn_ascii_to_pune
from spacewalk.common import initCFG, CFG, initLOG, log_debug, log_error
from spacewalk.server import rhnSQL
@@ -83,7 +84,7 @@ class Runner(jabber_lib.Runner):
self._password = config.get('password')
self._resource = 'superclient'
js = config.get('jabber_server')
- self._jabber_servers = [ js ]
+ self._jabber_servers = [ idn_ascii_to_pune(js) ]
def fix_connection(self, c):
"After setting up the connection, do whatever else is necessary"
commit d2d7d8263dfcf75610109982fcd4aeec8fb82cb2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 11 16:50:55 2011 +0100
683200 - instead of encodings.idna use wrapper from rhn.connections, which workaround corner cases
diff --git a/backend/common/rhnTB.py b/backend/common/rhnTB.py
index c46d048..0dee1f0 100644
--- a/backend/common/rhnTB.py
+++ b/backend/common/rhnTB.py
@@ -20,7 +20,7 @@ import time
import string
import traceback
from StringIO import StringIO
-import encodings.idna
+from rhn.connections import idn_pune_to_unicode
from rhnConfig import CFG
from rhnLog import log_error
@@ -124,7 +124,7 @@ def Traceback(method = None, req = None, mail = 1, ostream = sys.stderr,
t = time.ctime(time.time())
exc = StringIO()
- unicode_hostname = u'.'.join([encodings.idna.ToUnicode(x) for x in hostname.split('.')])
+ unicode_hostname = idn_pune_to_unicode(hostname)
exc.write("Exception reported from %s\nTime: %s\n" % (unicode_hostname, t))
exc.write("Exception type %s\n" % (e_type,))
if method:
diff --git a/backend/satellite_tools/rhn_satellite_activate.py b/backend/satellite_tools/rhn_satellite_activate.py
index 04e9dd3..02372a4 100644
--- a/backend/satellite_tools/rhn_satellite_activate.py
+++ b/backend/satellite_tools/rhn_satellite_activate.py
@@ -21,7 +21,7 @@ import gzip
import string
from optparse import Option, OptionParser
from rhn import rpclib
-import encodings.idna
+from rhn.connections import idn_ascii_to_pune
# Recent rhnlib has support for timing out, rather than hanging.
try:
@@ -502,13 +502,10 @@ def processCommandline():
if not CFG.RHN_PARENT:
sys.stderr.write("ERROR: rhn_parent is not set in /etc/rhn/rhn.conf\n")
sys.exit(1)
- options.server = encodings.idna.ToASCII(unicode(string.split(rhnLib.parseUrl(CFG.RHN_PARENT)[1], ':')[0], 'utf-8'))
+ options.server = idn_ascii_to_pune(string.split(rhnLib.parseUrl(CFG.RHN_PARENT)[1], ':')[0])
print 'RHN_PARENT: %s' % options.server
- if CFG.HTTP_PROXY:
- options.http_proxy = encodings.idna.ToASCII(unicode(CFG.HTTP_PROXY, 'utf-8'))
- else:
- options.http_proxy = None
+ options.http_proxy = idn_ascii_to_pune(CFG.HTTP_PROXY)
options.http_proxy_username = CFG.HTTP_PROXY_USERNAME
options.http_proxy_password = CFG.HTTP_PROXY_PASSWORD
options.ca_cert = CFG.CA_CHAIN
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index ca1ba3a..c1686f6 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -27,7 +27,7 @@ import types
import exceptions
import locale
from optparse import Option, OptionParser
-import encodings.idna
+from rhn.connections import idn_ascii_to_pune
import gettext
t = gettext.translation('spacewalk-backend-server', fallback=True)
@@ -2040,22 +2040,16 @@ def processCommandline():
# process anything CFG related (db, debug, server, and print)
#
CFG.set("TRACEBACK_MAIL", OPTIONS.traceback_mail or CFG.TRACEBACK_MAIL)
- CFG.set("RHN_PARENT", encodings.idna.ToASCII(unicode(OPTIONS.iss_parent or OPTIONS.server or \
- CFG.ISS_PARENT or CFG.RHN_PARENT, 'utf-8')))
+ CFG.set("RHN_PARENT", idn_ascii_to_pune(OPTIONS.iss_parent or OPTIONS.server or \
+ CFG.ISS_PARENT or CFG.RHN_PARENT))
if OPTIONS.server and not OPTIONS.iss_parent:
# server option on comman line should override ISS parent from config
CFG.set("ISS_PARENT", None)
else:
- if (OPTIONS.iss_parent or CFG.ISS_PARENT):
- CFG.set("ISS_PARENT", encodings.idna.ToASCII(unicode(OPTIONS.iss_parent or CFG.ISS_PARENT, 'utf-8')))
- else:
- CFG.set("ISS_PARENT", None)
+ CFG.set("ISS_PARENT", idn_ascii_to_pune(OPTIONS.iss_parent or CFG.ISS_PARENT))
CFG.set("ISS_CA_CHAIN", OPTIONS.ca_cert or CFG.ISS_CA_CHAIN or CFG.CA_CHAIN)
- if (OPTIONS.http_proxy or CFG.HTTP_PROXY):
- CFG.set("HTTP_PROXY", encodings.idna.ToASCII(unicode(OPTIONS.http_proxy or CFG.HTTP_PROXY, 'utf-8')))
- else:
- CFG.set("HTTP_PROXY", None)
+ CFG.set("HTTP_PROXY", idn_ascii_to_pune(OPTIONS.http_proxy or CFG.HTTP_PROXY))
CFG.set("HTTP_PROXY_USERNAME", OPTIONS.http_proxy_username or CFG.HTTP_PROXY_USERNAME)
CFG.set("HTTP_PROXY_PASSWORD", OPTIONS.http_proxy_password or CFG.HTTP_PROXY_PASSWORD)
CFG.set("CA_CHAIN", OPTIONS.ca_cert or CFG.CA_CHAIN)
diff --git a/backend/server/handlers/sat/auth.py b/backend/server/handlers/sat/auth.py
index 1cae81c..8e37801 100644
--- a/backend/server/handlers/sat/auth.py
+++ b/backend/server/handlers/sat/auth.py
@@ -15,7 +15,7 @@
# Satellite specific authentication xmlrpc method.
import time
-import encodings.idna
+from rhn.connections import idn_ascii_to_pune
from spacewalk.common import CFG, rhnFault, log_debug
from spacewalk.common.rhnTranslate import _
@@ -44,9 +44,9 @@ class Authentication(rhnHandler):
if CFG.ALLOWED_ISS_SLAVES:
if not isinstance(CFG.ALLOWED_ISS_SLAVES, list):
- allowed_iss_slaves = map(lambda x: encodings.idna.ToASCII(unicode(x, 'utf-8')), [CFG.ALLOWED_ISS_SLAVES])
+ allowed_iss_slaves = map(lambda x: idn_ascii_to_pune(x), [CFG.ALLOWED_ISS_SLAVES])
else:
- allowed_iss_slaves = encodings.idna.ToASCII(unicode(CFG.ALLOWED_ISS_SLAVES, 'utf-8'))
+ allowed_iss_slaves = idn_ascii_to_pune(CFG.ALLOWED_ISS_SLAVES)
else:
allowed_iss_slaves = []
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 1b66b92..5df793a 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -20,7 +20,7 @@ BuildArch: noarch
Requires: python, rpm-python
# /etc/rhn is provided by spacewalk-proxy-common or by spacewalk-config
Requires: /etc/rhn
-Requires: rhnlib >= 1.8
+Requires: rhnlib >= 2.5.35
# for Debian support
Requires: python-debian
Requires: %{name}-libs >= 1.1.16-1
@@ -251,7 +251,7 @@ Requires: cobbler >= 1.4.3
%if 0%{?rhel} && 0%{?rhel} < 5
Requires: rhnlib >= 2.1.4-14
%else
-Requires: rhnlib >= 2.5.22
+Requires: rhnlib >= 2.5.35
%endif
Obsoletes: rhns-satellite-tools < 5.3.0
Obsoletes: spacewalk-backend-satellite-tools <= 0.2.7
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 875cd30..db03e71 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -12,7 +12,7 @@ BuildArch: noarch
BuildRequires: update-desktop-files
%endif
-Requires: rhnlib >= 2.5.20
+Requires: rhnlib >= 2.5.35
Requires: rpm >= 4.2.3-24_nonptl
Requires: rpm-python
%if 0%{?rhel} && 0%{?rhel} <= 5
diff --git a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
index 2eea0b3..7dbfc3f 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
@@ -22,7 +22,7 @@
import sys
import os
-import encodings.idna
+from rhn.connections import idn_pune_to_unicode
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
@@ -196,7 +196,7 @@ class RegisterKsCli(rhncli.RhnCli):
ipaddr = hw.get('ipaddr')
if hostname:
- profileName = u'.'.join([encodings.idna.ToUnicode(x) for x in hostname.split('.')])
+ profileName = idn_pune_to_unicode(hostname)
else:
if ipaddr:
profileName = ipaddr
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 36234fd..ea85430 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -39,7 +39,6 @@ import gtk.glade
import gobject
import sys
import os
-import encodings.idna
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
@@ -58,6 +57,7 @@ import config
import OpenSSL
import up2dateLog
from rhn import rpclib
+from rhn.connections import idn_pune_to_unicode
import rhnreg_constants
cfg = config.initUp2dateConfig()
@@ -1191,7 +1191,7 @@ class HardwareDialog:
elif hw['class'] == 'NETINFO':
label = self.hwXml.get_widget("hostnameLabel")
try:
- label.set_text(u'.'.join([encodings.idna.ToUnicode(x) for x in hw['hostname'].split('.')]))
+ label.set_text(idn_pune_to_unicode(hw['hostname']))
except:
pass
label = self.hwXml.get_widget("ipLabel")
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index ca3f455..461f31f 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -23,7 +23,6 @@ t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
import snack
-import encodings.idna
import signal
import rhnreg, hardware
@@ -34,6 +33,7 @@ import up2dateLog
import config
import up2dateAuth
from rhn import rpclib
+from rhn.connections import idn_pune_to_unicode
from rhnreg_constants import *
@@ -658,7 +658,7 @@ class HardwareWindow:
for hw in tui.hardware:
if hw['class'] == 'NETINFO':
- unicode_hostname = u'.'.join([encodings.idna.ToUnicode(x) for x in hw['hostname'].split('.')])
+ unicode_hostname = idn_pune_to_unicode(hw['hostname'])
hardware_text += unicode_hostname + "\n"
if tui.profileName != "":
diff --git a/client/solaris/rhnclient/rhnclient.spec b/client/solaris/rhnclient/rhnclient.spec
index 568996e..f714673 100644
--- a/client/solaris/rhnclient/rhnclient.spec
+++ b/client/solaris/rhnclient/rhnclient.spec
@@ -13,6 +13,7 @@ BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
#BuildArch: noarch
Requires: pyOpenSSL python
+Requires: rhnlib >= 2.5.35
BuildRequires: python-devel binutils-devel
Url: http://rhn.redhat.com
diff --git a/client/solaris/rhnclient/rhnreg_ks.py b/client/solaris/rhnclient/rhnreg_ks.py
index 5f17e47..7fbb966 100755
--- a/client/solaris/rhnclient/rhnreg_ks.py
+++ b/client/solaris/rhnclient/rhnreg_ks.py
@@ -21,7 +21,7 @@ import getopt
import sys
import os
import string
-import encodings.idna
+from rhn.connections import idn_pune_to_unicode
PREFIX="/"
modulepath="%s/usr/share/rhn/" % PREFIX
@@ -118,7 +118,7 @@ def generateProfileName(hardwareList):
ipaddr = hw.get('ipaddr')
if hostname:
- profileName = encodings.idna.ToUnicode(hostname)
+ profileName = idn_pune_to_unicode(hostname)
else:
if ipaddr:
profileName = ipaddr
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index 76be682..ac70661 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -36,7 +36,7 @@ import string
import time
import urlparse
import rhnpush_confmanager
-import encodings.idna
+from rhn.connections import idn_ascii_to_pune
try:
from optparse import Option, OptionParser
@@ -104,7 +104,7 @@ def main():
sys.exit(0)
if options.proxy:
- options.proxy = encodings.idna.ToASCII(unicode(options.proxy, 'utf-8'))
+ options.proxy = idn_ascii_to_pune(options.proxy)
if options.list:
if not options.channel:
@@ -156,7 +156,7 @@ def main():
class UploadClass(uploadLib.UploadClass):
def setURL(self):
- server = encodings.idna.ToASCII(unicode(self.options.server, 'utf-8'))
+ server = idn_ascii_to_pune(self.options.server, 'utf-8')
if server is None:
self.die(1, "Required parameter --server not supplied")
scheme, netloc, path, params, query, fragment = urlparse.urlparse(server)
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 866eed9..6fd618a 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -11,7 +11,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: rpm-python
-Requires: rhnlib >= 2.5.32
+Requires: rhnlib >= 2.5.35
Requires: spacewalk-backend-libs >= 0.8.3
%if 0%{?rhel} && 0%{?rhel} < 5
Requires: up2date
diff --git a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
index 4fb5075..6852546 100755
--- a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
+++ b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
@@ -16,7 +16,7 @@ import string
import os
from os import path
from optparse import OptionParser
-import encodings.idna
+from rhn.connections import idn_ascii_to_pune
DATA_DIR = "./data/"
DATA_DIR_RHN = "/usr/share/rhn/channel-data/"
@@ -113,7 +113,7 @@ def main():
validate_options(options)
global server, user, password, filename, ssl, bundleSize, clone
- server = encodings.idna.ToASCII(unicode(options.server, 'utf-8'))
+ server = idn_ascii_to_pune(options.server)
user = options.user
password = options.password
if password == None:
diff --git a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
index 88001a4..419f53c 100644
--- a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
+++ b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
@@ -15,6 +15,7 @@ Source: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
+Requires: rhnlib >= 2.5.31
BuildRequires: python-devel
BuildRequires: docbook-utils
commit 5d77eb9195baedd8ad4cb9a4a8325598fe722d02
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 11 13:28:38 2011 +0100
683200 - refactor rhnMail to use python smtplib
rhnMail has problem sending unicode characters, instead of fixing this I choosed
to use python standard module
addressing:
Standard-error: ERROR: upon attempt to write to log file: 'ascii' codec can't encode character u'\u017e' in position 65: ordinal not in range(128)ERROR: upon attempt to write to log file: 'ascii' codec can't encode character u'\u017e' in position 119: ordinal not in range(128)Traceback (most recent call last):
File "/usr/bin/satellite-sync", line 175, in ?
systemExit_exception(7, "SYNC ERROR: attempting to display as much information as possible:", e)
File "/usr/bin/satellite-sync", line 125, in systemExit_exception
satsync.sendMail(forceEmail=1)
File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/satsync.py", line 362, in sendMail
rhnMail.send(headers, body, sender=sndr)
File "/usr/lib/python2.4/site-packages/spacewalk/common/rhnMail.py", line 71, in send
os.write(write, "\n%s\n" % body)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 48: ordinal not in range(128)
diff --git a/backend/common/rhnMail.py b/backend/common/rhnMail.py
index 5325627..19025d7 100644
--- a/backend/common/rhnMail.py
+++ b/backend/common/rhnMail.py
@@ -18,6 +18,7 @@
import os
import sys
import string
+import smtplib
from rhnConfig import CFG
from rhnLog import log_error
@@ -34,42 +35,22 @@ def __check_headers(h):
else:
to = h["To"]
if type(to) in [type([]), type(())]:
+ toaddrs = to
to = string.join(to, ', ')
+ else:
+ toaddrs = to.split(',')
h["To"] = to
- return h
+ return [h, toaddrs]
# check the headers for sanity cases and send the mail
def send(headers, body, sender = None, lazy = 0):
- headers = __check_headers(headers)
+ (headers, toaddrs) = __check_headers(headers)
+ if sender is None:
+ sender = headers["From"]
+ joined_headers = ''
+ for h in headers.keys():
+ joined_headers += "%s: %s\n" % (h, headers[h])
- sendmail = "/usr/sbin/sendmail"
- cmds = ["sendmail", "-oi", "-t"]
- if sender:
- cmds.append("-f%s" % sender)
- if lazy:
- cmds.append("-ODeliveryMode=q")
-
- (read, write) = os.pipe()
- childpid = os.fork()
- if childpid < 0: # fork failed
- log_error("ERROR: fork of sendmail process failed.\nAlert being sent:\n%s" % body)
- return -1
- if childpid == 0:
- # in the child
- os.dup2(read, 0)
- os.close(write)
- os.execv(sendmail, cmds)
- # not reached
- sys.exit(1)
- # main process
- os.close(read)
- # Now write the message out
- keys = headers.keys()
- keys.sort()
- for h in keys:
- os.write(write, "%s: %s\n" % (h, headers[h]))
- os.write(write, "\n%s\n" % body)
- os.close(write)
- # clean up
- (pid, status) = os.waitpid(childpid, 0)
- return status
+ server = smtplib.SMTP('localhost')
+ server.sendmail(sender, toaddrs, "%s\n%s\n" % (joined_headers, body))
+ server.quit()
commit 4e15891f9629c34ed7b9fc99908f2080a25b04bc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 11 11:29:55 2011 +0100
683200 - cStringIO could not handle Unicode
addressing:
Standard-error: ERROR: upon attempt to write to log file: 'ascii' codec can't encode character u'\u017e' in position 65: ordinal not in range(128)ERROR: upon attempt to write to log file: 'ascii' codec can't encode character u'\u017e' in position 119: ordinal not in range(128)Traceback (most recent call last):
File "/usr/bin/satellite-sync", line 175, in ?
systemExit_exception(7, "SYNC ERROR: attempting to display as much information as possible:", e)
File "/usr/bin/satellite-sync", line 120, in systemExit_exception
syncLib.log2email(-1, tb)
File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/syncLib.py", line 119, in log2email
log2stream(level, msg, cleanYN, notimeYN, EMAIL_LOG)
File "/usr/lib/python2.4/site-packages/spacewalk/satellite_tools/syncLib.py", line 110, in log2stream
stream.write(_prepLogMsg(m, cleanYN, notimeYN, shortYN=1) + '\n')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 101: ordinal not in range(128)
diff --git a/backend/satellite_tools/syncLib.py b/backend/satellite_tools/syncLib.py
index 356a1b8..fba756a 100644
--- a/backend/satellite_tools/syncLib.py
+++ b/backend/satellite_tools/syncLib.py
@@ -18,7 +18,7 @@ import os
import sys
import time
-from cStringIO import StringIO
+from StringIO import StringIO
# rhn imports:
from spacewalk.common import CFG, log_clean, rhnLib
commit d2e8e5e5e0a1b54f136238e36197afe84f17e829
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 10 11:07:57 2011 +0100
683200 - since email may be in Unicode we could not use cStringIO and we should set content type to utf-8
diff --git a/backend/common/rhnTB.py b/backend/common/rhnTB.py
index efd1583..c46d048 100644
--- a/backend/common/rhnTB.py
+++ b/backend/common/rhnTB.py
@@ -19,7 +19,7 @@ import sys
import time
import string
import traceback
-from cStringIO import StringIO
+from StringIO import StringIO
import encodings.idna
from rhnConfig import CFG
@@ -166,6 +166,8 @@ def Traceback(method = None, req = None, mail = 1, ostream = sys.stderr,
"From" : "%s <%s>" % (hostname, fr),
"To" : to,
"X-RHN-Traceback-Severity" : severity,
+ "Content-Type" : 'text/plain; charset="utf-8"',
+
}
QUIET_MAIL = QUIET_MAIL - 1 # count it no matter what
commit b803dd2a92c98bd977cf9de8921304535dbe1d03
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 9 12:20:01 2011 +0100
683200 - when reading hostname from config or command line, convert it to Pune encoding
diff --git a/backend/satellite_tools/rhn_satellite_activate.py b/backend/satellite_tools/rhn_satellite_activate.py
index eb4e14e..04e9dd3 100644
--- a/backend/satellite_tools/rhn_satellite_activate.py
+++ b/backend/satellite_tools/rhn_satellite_activate.py
@@ -21,6 +21,7 @@ import gzip
import string
from optparse import Option, OptionParser
from rhn import rpclib
+import encodings.idna
# Recent rhnlib has support for timing out, rather than hanging.
try:
@@ -501,10 +502,13 @@ def processCommandline():
if not CFG.RHN_PARENT:
sys.stderr.write("ERROR: rhn_parent is not set in /etc/rhn/rhn.conf\n")
sys.exit(1)
- options.server = string.split(rhnLib.parseUrl(CFG.RHN_PARENT)[1], ':')[0]
+ options.server = encodings.idna.ToASCII(unicode(string.split(rhnLib.parseUrl(CFG.RHN_PARENT)[1], ':')[0], 'utf-8'))
print 'RHN_PARENT: %s' % options.server
- options.http_proxy = CFG.HTTP_PROXY
+ if CFG.HTTP_PROXY:
+ options.http_proxy = encodings.idna.ToASCII(unicode(CFG.HTTP_PROXY, 'utf-8'))
+ else:
+ options.http_proxy = None
options.http_proxy_username = CFG.HTTP_PROXY_USERNAME
options.http_proxy_password = CFG.HTTP_PROXY_PASSWORD
options.ca_cert = CFG.CA_CHAIN
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 073736b..ca1ba3a 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -27,6 +27,7 @@ import types
import exceptions
import locale
from optparse import Option, OptionParser
+import encodings.idna
import gettext
t = gettext.translation('spacewalk-backend-server', fallback=True)
@@ -2039,16 +2040,22 @@ def processCommandline():
# process anything CFG related (db, debug, server, and print)
#
CFG.set("TRACEBACK_MAIL", OPTIONS.traceback_mail or CFG.TRACEBACK_MAIL)
- CFG.set("RHN_PARENT", OPTIONS.iss_parent or OPTIONS.server or \
- CFG.ISS_PARENT or CFG.RHN_PARENT)
+ CFG.set("RHN_PARENT", encodings.idna.ToASCII(unicode(OPTIONS.iss_parent or OPTIONS.server or \
+ CFG.ISS_PARENT or CFG.RHN_PARENT, 'utf-8')))
if OPTIONS.server and not OPTIONS.iss_parent:
# server option on comman line should override ISS parent from config
CFG.set("ISS_PARENT", None)
else:
- CFG.set("ISS_PARENT", OPTIONS.iss_parent or CFG.ISS_PARENT)
+ if (OPTIONS.iss_parent or CFG.ISS_PARENT):
+ CFG.set("ISS_PARENT", encodings.idna.ToASCII(unicode(OPTIONS.iss_parent or CFG.ISS_PARENT, 'utf-8')))
+ else:
+ CFG.set("ISS_PARENT", None)
CFG.set("ISS_CA_CHAIN", OPTIONS.ca_cert or CFG.ISS_CA_CHAIN or CFG.CA_CHAIN)
- CFG.set("HTTP_PROXY", OPTIONS.http_proxy or CFG.HTTP_PROXY)
+ if (OPTIONS.http_proxy or CFG.HTTP_PROXY):
+ CFG.set("HTTP_PROXY", encodings.idna.ToASCII(unicode(OPTIONS.http_proxy or CFG.HTTP_PROXY, 'utf-8')))
+ else:
+ CFG.set("HTTP_PROXY", None)
CFG.set("HTTP_PROXY_USERNAME", OPTIONS.http_proxy_username or CFG.HTTP_PROXY_USERNAME)
CFG.set("HTTP_PROXY_PASSWORD", OPTIONS.http_proxy_password or CFG.HTTP_PROXY_PASSWORD)
CFG.set("CA_CHAIN", OPTIONS.ca_cert or CFG.CA_CHAIN)
diff --git a/backend/server/handlers/sat/auth.py b/backend/server/handlers/sat/auth.py
index aa6d689..1cae81c 100644
--- a/backend/server/handlers/sat/auth.py
+++ b/backend/server/handlers/sat/auth.py
@@ -15,6 +15,7 @@
# Satellite specific authentication xmlrpc method.
import time
+import encodings.idna
from spacewalk.common import CFG, rhnFault, log_debug
from spacewalk.common.rhnTranslate import _
@@ -43,9 +44,9 @@ class Authentication(rhnHandler):
if CFG.ALLOWED_ISS_SLAVES:
if not isinstance(CFG.ALLOWED_ISS_SLAVES, list):
- allowed_iss_slaves = [CFG.ALLOWED_ISS_SLAVES]
+ allowed_iss_slaves = map(lambda x: encodings.idna.ToASCII(unicode(x, 'utf-8')), [CFG.ALLOWED_ISS_SLAVES])
else:
- allowed_iss_slaves = CFG.ALLOWED_ISS_SLAVES
+ allowed_iss_slaves = encodings.idna.ToASCII(unicode(CFG.ALLOWED_ISS_SLAVES, 'utf-8'))
else:
allowed_iss_slaves = []
commit 70bb943564f483c2b29ba3998874e962f92b8e1f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Mar 9 16:00:56 2011 +0100
683200 - when sending Traceback, convert hostname from Pune to Unicode
diff --git a/backend/common/rhnTB.py b/backend/common/rhnTB.py
index 8642d61..efd1583 100644
--- a/backend/common/rhnTB.py
+++ b/backend/common/rhnTB.py
@@ -20,6 +20,7 @@ import time
import string
import traceback
from cStringIO import StringIO
+import encodings.idna
from rhnConfig import CFG
from rhnLog import log_error
@@ -122,8 +123,9 @@ def Traceback(method = None, req = None, mail = 1, ostream = sys.stderr,
e_type, e_value = sys.exc_info()[:2]
t = time.ctime(time.time())
exc = StringIO()
-
- exc.write("Exception reported from %s\nTime: %s\n" % (hostname, t))
+
+ unicode_hostname = u'.'.join([encodings.idna.ToUnicode(x) for x in hostname.split('.')])
+ exc.write("Exception reported from %s\nTime: %s\n" % (unicode_hostname, t))
exc.write("Exception type %s\n" % (e_type,))
if method:
exc.write("Exception while handling function %s\n" % method)
@@ -160,7 +162,7 @@ def Traceback(method = None, req = None, mail = 1, ostream = sys.stderr,
fr = string.strip(to[0])
to = string.join(map(string.strip, to), ', ')
headers = {
- "Subject" : "RHN TRACEBACK from %s" % hostname,
+ "Subject" : "RHN TRACEBACK from %s" % unicode_hostname,
"From" : "%s <%s>" % (hostname, fr),
"To" : to,
"X-RHN-Traceback-Severity" : severity,
commit 0e5cbf85c38624dd0cfc82777dcd317d44a90ee8
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 8 23:42:37 2011 +0100
683200 - client/rhn-client-tools - when making profile name from hostname, convert it from Pune encoding
diff --git a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
index 072f69b..2eea0b3 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
@@ -22,6 +22,7 @@
import sys
import os
+import encodings.idna
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
@@ -195,7 +196,7 @@ class RegisterKsCli(rhncli.RhnCli):
ipaddr = hw.get('ipaddr')
if hostname:
- profileName = hostname
+ profileName = u'.'.join([encodings.idna.ToUnicode(x) for x in hostname.split('.')])
else:
if ipaddr:
profileName = ipaddr
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index edc9eb1..36234fd 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -39,6 +39,7 @@ import gtk.glade
import gobject
import sys
import os
+import encodings.idna
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
@@ -1190,7 +1191,7 @@ class HardwareDialog:
elif hw['class'] == 'NETINFO':
label = self.hwXml.get_widget("hostnameLabel")
try:
- label.set_text(hw['hostname'])
+ label.set_text(u'.'.join([encodings.idna.ToUnicode(x) for x in hw['hostname'].split('.')]))
except:
pass
label = self.hwXml.get_widget("ipLabel")
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index d46be2f..ca3f455 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -23,7 +23,7 @@ t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
import snack
-
+import encodings.idna
import signal
import rhnreg, hardware
@@ -658,12 +658,13 @@ class HardwareWindow:
for hw in tui.hardware:
if hw['class'] == 'NETINFO':
- hardware_text += hw['hostname'] + "\n"
+ unicode_hostname = u'.'.join([encodings.idna.ToUnicode(x) for x in hw['hostname'].split('.')])
+ hardware_text += unicode_hostname + "\n"
if tui.profileName != "":
self.profileEntry.set(tui.profileName)
else:
- self.profileEntry.set(hw['hostname'])
+ self.profileEntry.set(unicode_hostname)
hardware_text += _("CPU speed: ")
commit c4ba974546ae7fea0683ad647fe51bc76273f660
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 8 23:42:05 2011 +0100
683200 - client/solaris - when making profile name from hostname, convert it from Pune encoding
diff --git a/client/solaris/rhnclient/rhnclient.spec b/client/solaris/rhnclient/rhnclient.spec
index a6c1857..568996e 100644
--- a/client/solaris/rhnclient/rhnclient.spec
+++ b/client/solaris/rhnclient/rhnclient.spec
@@ -13,7 +13,7 @@ BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
#BuildArch: noarch
Requires: pyOpenSSL python
-BuildRequires: python-devel binutils-devel
+BuildRequires: python-devel binutils-devel
Url: http://rhn.redhat.com
%description
diff --git a/client/solaris/rhnclient/rhnreg_ks.py b/client/solaris/rhnclient/rhnreg_ks.py
index 3643730..5f17e47 100755
--- a/client/solaris/rhnclient/rhnreg_ks.py
+++ b/client/solaris/rhnclient/rhnreg_ks.py
@@ -21,6 +21,7 @@ import getopt
import sys
import os
import string
+import encodings.idna
PREFIX="/"
modulepath="%s/usr/share/rhn/" % PREFIX
@@ -117,7 +118,7 @@ def generateProfileName(hardwareList):
ipaddr = hw.get('ipaddr')
if hostname:
- profileName = hostname
+ profileName = encodings.idna.ToUnicode(hostname)
else:
if ipaddr:
profileName = ipaddr
commit 18bc018399bff4c879cb9f0ce544e7a3e79fad8d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 8 23:40:41 2011 +0100
683200 - rhnpush.py - convert servername from input to Pune encodings
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index 5a74fd6..76be682 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -36,6 +36,7 @@ import string
import time
import urlparse
import rhnpush_confmanager
+import encodings.idna
try:
from optparse import Option, OptionParser
@@ -102,6 +103,9 @@ def main():
optionParser.print_usage()
sys.exit(0)
+ if options.proxy:
+ options.proxy = encodings.idna.ToASCII(unicode(options.proxy, 'utf-8'))
+
if options.list:
if not options.channel:
upload.die(1, "Must specify a channel for --list to work")
@@ -152,7 +156,7 @@ def main():
class UploadClass(uploadLib.UploadClass):
def setURL(self):
- server = self.options.server
+ server = encodings.idna.ToASCII(unicode(self.options.server, 'utf-8'))
if server is None:
self.die(1, "Required parameter --server not supplied")
scheme, netloc, path, params, query, fragment = urlparse.urlparse(server)
commit a5f07edfee05546ee42e6fe8b89747372c3834ba
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 8 23:39:58 2011 +0100
683200 - spacewalk-create-channel - convert servername from input to Pune encodings
diff --git a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
index 0d2c6a4..4fb5075 100755
--- a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
+++ b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/spacewalk-create-channel
@@ -16,7 +16,7 @@ import string
import os
from os import path
from optparse import OptionParser
-
+import encodings.idna
DATA_DIR = "./data/"
DATA_DIR_RHN = "/usr/share/rhn/channel-data/"
@@ -113,7 +113,7 @@ def main():
validate_options(options)
global server, user, password, filename, ssl, bundleSize, clone
- server = options.server
+ server = encodings.idna.ToASCII(unicode(options.server, 'utf-8'))
user = options.user
password = options.password
if password == None:
commit 695e8f7a792996b7e51f9fd2b11789d26e625753
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 8 21:41:21 2011 +0100
683200 - convert db-host from IDN to ascii
db will not probably support it - definitelly Oracle,
but we can be step ahead
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index c0c208e..72d7225 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -30,7 +30,7 @@ use Sys::Hostname ();
use Spacewalk::Setup ();
use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use IO::Socket ();
-
+use Net::LibIDN ();
use RHN::DB ();
my $DEBUG;
@@ -1033,7 +1033,7 @@ sub populate_initial_configs {
db_user => $answers->{'db-user'},
db_password => $answers->{'db-password'},
db_name => $answers->{'db-name'},
- db_host => $answers->{'db-host'},
+ db_host => $answers->{'db-host'}),
db_port => $answers->{'db-port'},
hibernate_dialect => $hibernate_dialect,
hibernate_driver => $hibernate_driver,
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 8a64a5c..01326a1 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -17,6 +17,7 @@ use Pod::Usage qw(pod2usage);
use POSIX ":sys_wait_h";
use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use Socket;
+use Net::LibIDN ();
use Params::Validate qw(validate);
Params::Validate::validation_options(strip_leading => "-");
@@ -189,6 +190,7 @@ sub load_answer_file {
close FH;
}
+ $answers->{'db-host'} = Net::LibIDN::idn_to_ascii($answers->{'db-host'})
return;
}
@@ -751,6 +753,7 @@ REDO_CONNECT:
-default => 'localhost',
-answer => \$answers->{'db-host'});
+ $answers->{'db-host'} = Net::LibIDN::idn_to_ascii($answers->{'db-host'})
$data{'db-name'} = _oracle_make_dsn_string($answers);
if (defined $data{'db-name'}) {
# Try db-name as SID for host (//host:port/name).
@@ -844,6 +847,7 @@ sub postgresql_get_database_answers {
-answer => \$answers->{'db-host'});
if ($answers->{'db-host'} ne '') {
+ $answers->{'db-host'} = Net::LibIDN::idn_to_ascii($answers->{'db-host'})
ask(
-noninteractive => $opts->{"non-interactive"},
-question => "Port",
12 years, 8 months
client/rhel
by Milan Zazrivec
client/rhel/rhn-client-tools/data/rh_register.glade | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit b247ea53c0a776d2f8dab476ae16221a61707242
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Mar 30 11:27:55 2011 +0200
691837 - default to RHN Classic in firstboot
diff --git a/client/rhel/rhn-client-tools/data/rh_register.glade b/client/rhel/rhn-client-tools/data/rh_register.glade
index 11b14f3..6a06f6d 100644
--- a/client/rhel/rhn-client-tools/data/rh_register.glade
+++ b/client/rhel/rhn-client-tools/data/rh_register.glade
@@ -278,7 +278,7 @@ You may access the software update tool by running <b>Software Update</
<property name="visible">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- <property name="active">False</property>
+ <property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
12 years, 8 months
Changes to 'refs/tags/osad-5.10.6-1'
by Jan Pazdziora
Tag 'osad-5.10.6-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-03-30 09:45 +0000
Tagging package [osad] version [5.10.6-1] in directory [client/tools/osad/].
Changes since rhnlib-2.5.37-1:
Jan Pazdziora (1):
Automatic commit of package [osad] release [5.10.6-1].
---
client/tools/osad/osad.spec | 7 ++++++-
rel-eng/packages/osad | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
---
12 years, 8 months
client/tools rel-eng/packages
by Jan Pazdziora
client/tools/osad/osad.spec | 7 ++++++-
rel-eng/packages/osad | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit d3c19f4d6b4f110c75e2be5f67c3f5c3407ea67c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 30 11:45:20 2011 +0200
Automatic commit of package [osad] release [5.10.6-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 5f948f3..dd486e2 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.10.5
+Version: 5.10.6
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -228,6 +228,11 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
%attr(0755,root,root) %{_sbindir}/osa-dispatcher-selinux-enable
%changelog
+* Wed Mar 30 2011 Jan Pazdziora 5.10.6-1
+- no need to support rhel2 (msuchy(a)redhat.com)
+- RHEL 4 is no longer a target version for osa-dispatcher, fixing .spec to
+ always build osa-dispatcher-selinux.
+
* Tue Mar 08 2011 Michael Mraka <michael.mraka(a)redhat.com> 5.10.5-1
- fixed osad last_message_time update (PG)
- fixed osad next_action_time update (PG)
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index d2ab3af..b8ba741 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.10.5-1 client/tools/osad/
+5.10.6-1 client/tools/osad/
12 years, 8 months
Changes to 'refs/tags/rhnlib-2.5.37-1'
by Jan Pazdziora
Tag 'rhnlib-2.5.37-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-03-30 09:44 +0000
Tagging package [rhnlib] version [2.5.37-1] in directory [client/rhel/rhnlib/].
Changes since spacewalk-admin-1.4.2-1:
Jan Pazdziora (1):
Automatic commit of package [rhnlib] release [2.5.37-1].
---
client/rhel/rhnlib/rhnlib.spec | 6 +++++-
rel-eng/packages/rhnlib | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
12 years, 8 months
client/rhel rel-eng/packages
by Jan Pazdziora
client/rhel/rhnlib/rhnlib.spec | 6 +++++-
rel-eng/packages/rhnlib | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 310845e7c662ca99020f1a0754a7fb4fd8c4efc8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 30 11:44:54 2011 +0200
Automatic commit of package [rhnlib] release [2.5.37-1].
diff --git a/client/rhel/rhnlib/rhnlib.spec b/client/rhel/rhnlib/rhnlib.spec
index 97c196f..40850bc 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.36
+Version: 2.5.37
Release: 1%{?dist}
Group: Development/Libraries
@@ -61,6 +61,10 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitelib}/*
%changelog
+* Wed Mar 30 2011 Jan Pazdziora 2.5.37-1
+- string does not exist, str is the correct thing to use here...
+ (jsherril(a)redhat.com)
+
* Wed Mar 16 2011 Miroslav Suchý <msuchy(a)redhat.com> 2.5.36-1
- code cleanup - remove HTTPResponse.read() override
diff --git a/rel-eng/packages/rhnlib b/rel-eng/packages/rhnlib
index 07a2d67..fd35a69 100644
--- a/rel-eng/packages/rhnlib
+++ b/rel-eng/packages/rhnlib
@@ -1 +1 @@
-2.5.36-1 client/rhel/rhnlib/
+2.5.37-1 client/rhel/rhnlib/
12 years, 8 months