ceilometer.storage.hbase.utils.prepare_key fail on 32-bits system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Medium
|
ZhiQiang Fan |
Bug Description
when run tox on 32-bits ubuntu 12.04 system, it fails
for i.e:
tox -edebug -- ceilometer.
see: http://
the problem is that:
ceilometer.
def prepare_key(*args):
"""Prepares names for rows and columns with correct separator.
:param args: strings or numbers that we want our key construct of
:return: key with quoted args that are separated with character ":"
"""
key_quote = []
for key in args:
if isinstance(key, int):
key = str(key)
return ":".join(key_quote)
but ceilometer/
def record_
"""Record alarm change event."""
ts = alarm_change.
rts = hbase_utils.
with self.conn_
but
def timestamp(dt, reverse=True):
"""Timestamp is count of milliseconds since start of epoch.
If reverse=True then timestamp will be reversed. Such a technique is used
in HBase rowkey design when period queries are required. Because of the
fact that rows are sorted lexicographically it's possible to vary whether
the 'oldest' entries will be on top of the table or it should be the newest
ones (reversed timestamp case).
:param dt: datetime which is translated to timestamp
:param reverse: a boolean parameter for reverse or straight count of
timestamp in milliseconds
:return: count or reversed count of milliseconds since start of epoch
"""
epoch = datetime.
td = dt - epoch
ts = td.microseconds + td.seconds * 1000000 + td.days * 86400000000
return 0x7fffffffffffffff - ts if reverse else ts
the type of return value of timestamp is different on 32-bits system and 64-bits system, on 32-bits system, the return value is too large, which will finally be long object
Are we going to support 32-bits as well?
Since code are run on 64-bits server, this is not a problem, but for some poor developer like me who only has slow laptop, it is not convenient because my local test will fail forever.....
The fix is quite simple, add another instance check for long type, then it is ok to go
Changed in devstack: | |
assignee: | nobody → ZhiQiang Fan (aji-zqfan) |
affects: | devstack → ceilometer |
Changed in ceilometer: | |
milestone: | none → kilo-1 |
importance: | Undecided → Medium |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | kilo-1 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/132387
Review: https:/