Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 845198 - Locale cannot be switched
Summary: Locale cannot be switched
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Og Maciel
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-02 08:27 UTC by Lukas Zapletal
Modified: 2019-09-26 15:52 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
System Engine used the system's default locale regardless of what had been chosen as locale. This patch enables setting the locale via the "LC_ALL" option on the command line. This sends the correct locale to the server. Local messages from the client are now sent correctly.
Clone Of:
Environment:
Last Closed: 2012-12-04 19:51:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 848038 0 unspecified CLOSED Locale files for CLI are not installed 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2012:1543 0 normal SHIPPED_LIVE Important: CloudForms System Engine 1.1 update 2012-12-05 00:39:57 UTC

Internal Links: 848038

Description Lukas Zapletal 2012-08-02 08:27:08 UTC
Description of problem:

When you try to explicitely switch over to a different locale:

LC_ALL=fr katello environment list

katello always use systems default one.

All versions of CFSE, Katello and SAM.

To fix this issue, make sure:

1) it sends out correct locale to the server in HTTP header
2) it switches client to correct locale so local messages are correct

Comment 1 Miroslav Suchý 2012-08-24 20:08:48 UTC
https://github.com/Katello/katello/pull/471

Comment 2 Miroslav Suchý 2012-08-27 08:00:05 UTC
We still have in our code:
  from gettext import gettext as _
while I believe that correct is to convert all string to unicode as soon as possible and therefore use:
  from gettext import ugettext as _

Comment 3 Miroslav Suchý 2012-08-28 08:51:09 UTC
Today nightly (with pull 471 in place results in:
[root@ibm-x3655-03 ~]# export LANG=de_DE
[root@ibm-x3655-03 ~]# kk --help
error: 'ascii' codec can't decode byte 0xc3 in position 93: ordinal not in range(128) (more in the log file /var/log/katello/client.log)

Comment 4 Miroslav Suchý 2012-08-28 09:44:03 UTC
Proposed fix:
https://github.com/Katello/katello/pull/529

Comment 7 Og Maciel 2012-09-14 22:10:38 UTC
# LANG=it katello --help
Usage:  katello <options> <command>
Supported Commands:
	activation_key azioni specifiche alla chiave di attivazione nel server di katello
	admin          various administrative actions
	changeset      Azioni specifiche al changeset nel server di katello
	client         azioni specifiche del client nel server di katello
	distribution   azioni specifiche per il repo nel server di katello
	environment    azioni specifiche all'ambiente nel server di katello
	errata         azioni specifiche dell'errata nel server di katello
	filter         azioni specifiche del filtro nel server di katello
	gpg_key        azioni specifiche della chiave GPG nel server di katello
	org            azioni specifiche dell'organizzazione nel server di katello
	package        azioni specifiche al pacchetto nel server di katello
	package_group  azioni specifiche al gruppo di pacchetti nel server di katello
	permission     azioni specifiche al permesso nel server di katello
	ping           acquisisci lo stato del server di katello
	product        azioni specifiche del prodotto nel server di katello
	provider       azioni specifiche del provider nel server di katello
	repo           azioni specifiche per il repo nel server di katello
	shell          esegui cli come una shell
	sync_plan      azioni specifiche del programma di sincronizzazione nel server di katello
	system         azioni specifiche del sistema nel server di katello
	system_group   system group specific actions in the katello server
	template       azioni specifiche del template nel server di katello
	user           azioni specifiche dell'utente nel server di katello
	user_role      azioni specifiche del ruolo utente nel server di katello
	version        get the version of the katello server

Options:
  -h, --help            show this help message and exit
  -v, --version         prints version information
  -d, --debug           send debug information into logs

  Credenziali account utente di katello:
    -u USERNAME, --username=USERNAME
                        nome utente account
    -p PASSWORD, --password=PASSWORD
                        password account

  Informazioni server di katello:
    --host=HOST         Hostname del server di katello (default:
                        localhost.localdomain)
# LANG=ko katello --help
Usage:  katello <options> <command>
Supported Commands:
	activation_key katello 서버에서 활성키의 특정 동작 
	admin          various administrative actions
	changeset      katello 서버에서 변경 집합의 특정 동작  
	client         katello 서버에서 클라이언트의 특정 동작 
	distribution   katello 서버에서 리포지터리의 특정 동작 
	environment    katello 서버 환경의 특정 동작  
	errata         katello 서버에서 에라타의 특정 동작 
	filter         katello 서버에서 필터의 특정 동작 
	gpg_key        katello 서버에서 GPG 키의 특정 동작 
	org            katello 서버에서 조직의 특정 동작 
	package        katello 서버에서 패키지의 특정 동작 
	package_group  katello 서버에서 패키지 그룹의 특정 동작 
	permission     katello 서버에서 권한의 특정 동작 
	ping            katello 서버의 상태 획득 
	product        katello 서버에서 제품의 특정 동작 
	provider       katello 서버에서 공급자의 특정 동작 
	repo           katello 서버에서 리포지터리의 특정 동작 
	shell          쉘로 cli를 실행 
	sync_plan      katello 서버에 있는 동기화 계획의 특정 동작 
	system         katello 서버에서 시스템의 특정 동작 
	system_group   system group specific actions in the katello server
	template       katello 서버에서 템플릿의 특정 동작 
	user           katello 서버에서 실행되는 사용자의 특정 동작 
	user_role      katello 서버에서 사용자 역할의 특정 동작 
	version        get the version of the katello server

Options:
  -h, --help            show this help message and exit
  -v, --version         prints version information
  -d, --debug           send debug information into logs

  Katello 사용자 계정 인증서 :
    -u USERNAME, --username=USERNAME
                        계정 사용자 이름
    -p PASSWORD, --password=PASSWORD
                        계정 암호

  Katello 서버 정보 :
    --host=HOST         katello 서버 호스트 이름 (디폴트: localhost.localdomain)

Comment 8 Og Maciel 2012-09-14 22:10:56 UTC
Verified using:

* candlepin-0.7.8-1.el6cf.noarch
* candlepin-selinux-0.7.8-1.el6cf.noarch
* candlepin-tomcat6-0.7.8-1.el6cf.noarch
* katello-1.1.12-7.el6cf.noarch
* katello-all-1.1.12-7.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-4.el6cf.noarch
* katello-cli-common-1.1.8-4.el6cf.noarch
* katello-common-1.1.12-7.el6cf.noarch
* katello-configure-1.1.9-3.el6cf.noarch
* katello-glue-candlepin-1.1.12-7.el6cf.noarch
* katello-glue-pulp-1.1.12-7.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-1.el6cf.noarch
* pulp-1.1.12-1.el6cf.noarch
* pulp-common-1.1.12-1.el6cf.noarch
* pulp-selinux-server-1.1.12-1.el6cf.noarch

Comment 9 Ivan Necas 2012-10-05 09:55:25 UTC
However, this fails for some values of LANG, e.g.:

LANG=ja_JP.UTF8 katello -u admin -p admin ping

error: category LC_ALL is not supported (more in the log file /var/log/katello/c
lient.log)

  File "/usr/lib/python2.6/site-packages/katello/client/cli/base.py", line 147, 
in setup_server
    self._server = server.KatelloServer(host, int(port), scheme, path, self.__se
rver_locale())
  File "/usr/lib/python2.6/site-packages/katello/client/cli/base.py", line 157, 
in __server_locale
    loc = locale.getlocale(locale.LC_ALL)[0] or locale.getdefaultlocale()[0]
  File "/usr/lib64/python2.6/locale.py", line 496, in getlocale
    raise TypeError, 'category LC_ALL is not supported'
TypeError: category LC_ALL is not supported



The system is RHEL 6.3

Comment 10 Ivan Necas 2012-10-05 10:27:12 UTC
Note:

this happens only when this environment variable is set:

LC_CTYPE=en_US.UTF-8

Comment 13 Og Maciel 2012-10-08 21:52:42 UTC
# LANG=ja_JP.UTF8 katello -u admin -p admin ping
--------------------------------------------------------------------------------------------------------------
                                               Katello ステータス

 状態     Service          結果     Duration   Message  
--------------------------------------------------------------------------------------------------------------
 ok                                                 
        candlepin        ok     32ms                
        candlepin_auth   ok     31ms                
        elasticsearch    ok     75ms                
        katello_jobs     ok     59ms                
        pulp             ok     297ms               
        pulp_auth        ok     59ms

Comment 14 Og Maciel 2012-10-08 21:53:25 UTC
[root@qetello04 ~]# LANG=pt_BR katello -u admin -p admin ping
--------------------------------------------------------------------------------------------------------------
                                             Status do Katello

 Status   Service          Resultado   Duration   Message  
--------------------------------------------------------------------------------------------------------------
 ok                                                        
          candlepin        ok          30ms                
          candlepin_auth   ok          40ms                
          elasticsearch    ok          25ms                
          katello_jobs     ok          34ms                
          pulp             ok          61ms                
          pulp_auth        ok          78ms                
[root@qetello04 ~]# LANG=fr katello -u admin -p admin ping
--------------------------------------------------------------------------------------------------------------
                                                État Katello

 État   Service          Résultat   Duration   Message  
--------------------------------------------------------------------------------------------------------------
 ok                                                     
        candlepin        ok         26ms                
        candlepin_auth   ok         203ms               
        elasticsearch    ok         16ms                
        katello_jobs     ok         40ms                
        pulp             ok         52ms                
        pulp_auth        ok         57ms

Comment 15 Og Maciel 2012-10-08 21:53:55 UTC
Verified:

* candlepin-0.7.8.1-1.el6cf.noarch
* candlepin-selinux-0.7.8.1-1.el6cf.noarch
* candlepin-tomcat6-0.7.8.1-1.el6cf.noarch
* katello-1.1.12-14.el6cf.noarch
* katello-all-1.1.12-14.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-7.el6cf.noarch
* katello-cli-common-1.1.8-7.el6cf.noarch
* katello-common-1.1.12-14.el6cf.noarch
* katello-configure-1.1.9-7.el6cf.noarch
* katello-glue-candlepin-1.1.12-14.el6cf.noarch
* katello-glue-pulp-1.1.12-14.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-1.el6cf.noarch
* pulp-1.1.12-1.el6cf.noarch
* pulp-common-1.1.12-1.el6cf.noarch
* pulp-selinux-server-1.1.12-1.el6cf.noarch

Comment 17 errata-xmlrpc 2012-12-04 19:51:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1543.html


Note You need to log in before you can comment on or make changes to this bug.