Stop using deprecated oslo_utils.timeutils.isotime

Bug #1694352 reported by Tuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
Tuan

Bug Description

The function 'oslo_utils.timeutils.isotime()' is deprecated in
version '1.6' and will be removed in a future version.
We are using datetime.datetime.isoformat() instead[1]. But unfortunately the datetime.datetime.utcfromtimestamp(time.time()).isoformat() does not give you the same output as oslo_utils.timeutils.isotime(datetime.datetime.utcfromtimestamp(time.time())). While the latter gives you timezone information "Z", the former just gives you a timestamp.... So, for end users, this is a regression, as far as this API is concerned. However, we have stated in the documentation that all timestamps within manila APIs may not provide timezone information.

The string is used in tokens and other public APIs and we can't change it without potentially breaking clients.Thus, the workaround is to copy the current implementation from oslo_utils.timeutils.isotime() to manila.utils.isotime().

[1]http://docs.openstack.org/developer/oslo.utils/api/timeutils.html#oslo_utils.timeutils.isotime

Changed in manila:
assignee: nobody → Tuan (tuanla)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/468824
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=ac60df2beb1e6b0fcfc384c858ecf2139307a332
Submitter: Jenkins
Branch: master

commit ac60df2beb1e6b0fcfc384c858ecf2139307a332
Author: Luong Anh Tuan <email address hidden>
Date: Mon May 29 23:31:39 2017 +0700

    Replace oslo_utils.timeutils.isotime

    Function 'oslo_utils.timeutils.isotime()' is deprecated in version '1.6'
    and will be removed in a future version. We can't use
    datetime.datetime.isoformat() instead. Because the format of the string
    generated by isoformat isn't the same as the format of the string
    generated by isotime. The string is used in tokens and other public
    APIs and we can't change it without potentially breaking clients.

    So the workaround is to copy the current implementation from
    oslo_utils.timeutils.isotime() to utils.py

    For more informations:
    http://docs.openstack.org/developer/oslo.utils/api/timeutils.html#oslo_utils.timeutils.isotime

    APIImpact

    Closes-Bug: #1694352

    Change-Id: I2feb85b7f698ae456493d02a118bb3fb969835da

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 5.0.0.0b2

This issue was fixed in the openstack/manila 5.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/searchlight 3.0.0.0b3

This issue was fixed in the openstack/searchlight 3.0.0.0b3 development milestone.

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.