[
https://issues.apache.org/jira/browse/AMBARI-14823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15121078#comment-15121078
]
jun aoki commented on AMBARI-14823:
-----------------------------------
Hi [~ajisakaa], I was hoping that I could get a failure on your additional unit
test if I didn't apply your change on logger.py, but was not successful.
https://github.com/jaoki/ambari/pull/1/files
I did change LANG as well.
{code}
jaoki@junubuntu:~$ env | grep LAN
LANG=ja_JP.UTF-8
GDM_LANG=ja_JP
LANGUAGE=ja_JP
{code}
The test did not fail.
{code}
5 test_invalid (TestFileSystem.TestFileSystem) ... ok
6 test_filter_nonascii_str (TestLogger.TestLogger) ... → SOME_PROTECTED_STRING
7 ok
8 test_create_template_with_tag
(TestTemplateConfigResource.TestTemplateConfigResource) ... ok
{code}
Again I'm not knowledgeable on this so I could be totally mistaken.
> filter_text in logger.py fails to replace non-ascii text
> --------------------------------------------------------
>
> Key: AMBARI-14823
> URL: https://issues.apache.org/jira/browse/AMBARI-14823
> Project: Ambari
> Issue Type: Bug
> Environment: Ambari 2.2.0, HDP 2.3.4, LANG=ja_JP.UTF-8
> Reporter: Akira AJISAKA
> Assignee: Akira AJISAKA
> Labels: i18n
> Attachments: AMBARI-14823.patch
>
>
> If the error message includes non-ascii string, filter_text fails.
> {noformat}
> Traceback (most recent call last):
> File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
> line 245, in <module>
> HiveMetastore().execute()
> File
> "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py",
> line 219, in execute
> method(env)
> File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_metastore.py",
> line 60, in start
> hive_service('metastore', action='start', upgrade_type=upgrade_type)
> File "/usr/lib/python2.6/site-packages/ambari_commons/os_family_impl.py",
> line 89, in thunk
> return fn(*args, **kwargs)
> File
> "/var/lib/ambari-agent/cache/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py",
> line 68, in hive_service
> pid = get_user_call_output.get_user_call_output(format("cat {pid_file}"),
> user=params.hive_user, is_checked_call=False)[1]
> File
> "/usr/lib/python2.6/site-packages/resource_management/libraries/functions/get_user_call_output.py",
> line 58, in get_user_call_output
> err_msg = Logger.filter_text(("Execution of '%s' returned %d. %s") %
> (command_string, code, all_output))
> File "/usr/lib/python2.6/site-packages/resource_management/core/logger.py",
> line 98, in filter_text
> text.replace(unprotected_string, protected_string)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 117:
> ordinal not in range(128)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)