Error in alarm evaluation when timezone in time_constraints is specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Medium
|
Rikimaru Honjo |
Bug Description
Define a alarm with timezone in time_constraints is specified as follws:
curl -v -X POST -H 'X-Auth-
The following error occurs when Alarm evaluator tries to evaluate the alarm:
2014-06-27 15:06:36.017 7694 ERROR ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
2014-06-27 15:06:36.017 7694 TRACE ceilometer.
The error says that astimezone() cannot be applied to a native datetime (now_utc).
Thus, making now_utc to non-native (aware object) will solve the problem.
The following code will do.
>>> import datetime
>>> now_utc = datetime.
>>> print now_utc.tzinfo
None
>>> import pytz
>>> tz = pytz.timezone(
>>> now_tz = now_utc.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: astimezone() cannot be applied to a naive datetime
>>>
>>> utc = pytz.timezone(
>>> now_tz = now_utc.
>>>
Changed in ceilometer: | |
assignee: | nobody → Rikimaru Honjo (honjo-rikimaru-c6) |
Changed in ceilometer: | |
milestone: | none → juno-3 |
importance: | Undecided → Medium |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | juno-3 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/107332
Review: https:/