Comment 4 for bug 1621305

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/368418
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=e3752c1e485f885d982725e3c6ece2eb6f2bdc36
Submitter: Jenkins
Branch: master

commit e3752c1e485f885d982725e3c6ece2eb6f2bdc36
Author: Hanxi <email address hidden>
Date: Sun Sep 11 17:25:01 2016 +0800

    Fix UnicodeEncodeError in Ceilometer polling

    In PY3, all strings are sequences of unicode characters. In PY2,
    a string may be of type str or of type unicode. Six provides
    simple utilities for wrapping over differences between Python 2
    and Python 3.[1] So using six.text_type instead of str to be more
    compatible.
    Python 2.x automatically encode the unicode with sys.getdefaultencoding(),
    which is usually 'ascii'. If there are some non-ASCII characters, it can
    raise UnicodeeEncodeError. Add a unit test that use unicode string to test
    PartitionCoordinator to check if there have the same error in the bug.

    [1] https://pythonhosted.org/six/#six.text_type

    Change-Id: Ic52c805b81e53a632a61ddcd3e8652b5849d913d
    Closes-Bug: #1621305