centos-binary-cloudkitty-api:train-centos8 broken (probably train and ussuri too)

Bug #1888533 reported by Pierre Riteau
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla
New
Undecided
Unassigned

Bug Description

CloudKitty became timezone-aware in Train: https://review.opendev.org/#/c/669192/
The code references tz.UTC from dateutil. However, this was added only in dateutil 2.7.0, while train-centos8 images use package python3-dateutil-2.6.1-6.el8.noarch.

The train CentOS 7 image (even older dateutil version) and the ussuri image are probably broken in a similar way.

Resulting backtrace in cloudkitty-api.log:

2020-07-22 16:33:11.207 26 ERROR wsme.api [req-3c49884a-1412-42bb-a57e-e7c731360148 ef450a969a2945928d3ade785eaae860 19df0f36ede14c29be9ca476222f8ba9 default - -] Server-side error:
 "module 'dateutil.tz' has no attribute 'UTC'". Detail:
Traceback (most recent call last):

  File "/usr/lib/python3.6/site-packages/wsmeext/pecan.py", line 85, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python3.6/site-packages/cloudkitty/api/v1/controllers/storage.py", line 71, in get_all
    paginate=False)

  File "/usr/lib/python3.6/site-packages/cloudkitty/storage/v2/influx.py", line 311, in retrieve
    begin, end = self._check_begin_end(begin, end)

  File "/usr/lib/python3.6/site-packages/cloudkitty/storage/v2/influx.py", line 271, in _check_begin_end
    end = tzutils.get_next_month()

  File "/usr/lib/python3.6/site-packages/cloudkitty/tzutils.py", line 150, in get_next_month
    return add_delta(start, datetime.timedelta(days=month_days))

  File "/usr/lib/python3.6/site-packages/cloudkitty/tzutils.py", line 104, in add_delta
    return utc_to_local(local_to_utc(dt, naive=True) + delta)

  File "/usr/lib/python3.6/site-packages/cloudkitty/tzutils.py", line 52, in local_to_utc
    output = dt.astimezone(tz.UTC)

AttributeError: module 'dateutil.tz' has no attribute 'UTC'

Pierre Riteau (priteau)
summary: - centos-binary-cloudkitty-api:train-centos8 broken (probably train too)
+ centos-binary-cloudkitty-api:train-centos8 broken (probably train and
+ ussuri too)
Pierre Riteau (priteau)
affects: kolla-ansible → kolla
Revision history for this message
Pierre Riteau (priteau) wrote :

This bug was fixed during the Victoria development cycle in CloudKitty itself with change https://review.opendev.org/c/openstack/cloudkitty/+/747057.

The fix was backported to Ussuri (from 12.1.0) and Train (from 11.1.0).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.