Unlike fixed sample keys as counter_name and counter_volume, metadata keys may contain a unicode in keys. ceilometer.publisher_utils.compute_signature can't calculate signature of unicode symbols and crashes. So we should encode keys when signature is computed.
Traceback (most recent call last):
File "ceilometer/tests/base.py", line 99, in skip_if_not_implemented
return func(*args, **kwargs)
File "ceilometer/tests/api/v2/test_list_meters_scenarios.py", line 182, in setUp
self.CONF.publisher.metering_secret)
File "ceilometer/publisher/utils.py", line 122, in meter_message_from_counter
msg['message_signature'] = compute_signature(msg, secret)
File "ceilometer/publisher/utils.py", line 51, in compute_signature
digest_maker.update(name)
File "/usr/lib/python2.7/hmac.py", line 83, in update
self.inner.update(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-31: ordinal not in range(128)
}}}
Fix proposed to branch: master /review. openstack. org/133707
Review: https:/