created_at and updated_at times don't include timezone

Bug #1561200 reported by Steve McLellan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

created_at and updated_at were recently added to the API calls and notifications for many neutron resources (networks, subnets, ports, possibly more), which is awesome! I've noticed that the times don't include a timezone (compare to nova servers and glance images, for instance).

Even if there's an assumption a user can make, this can create problems with some display tools (I noticed this because a javascript date formatting filter does local timezone conversions when a timezone is created, which meant times for resources created seconds apart looked as though they were several hours adrift.

Tested on neutron mitaka RC1.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

AFAIK the time reported is UTC, you can convert it to local time if need be.

Changed in neutron:
status: New → Incomplete
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :
Revision history for this message
Steve McLellan (sjmc7) wrote :

Thanks Armando - the AFAIK is the problem; consuming code can't/won't necessarily make this assumption (many code libraries will assume timezone-less values to be in local timezone). In our case we can do the conversion ourselves, but for consistency with other services it would be nice to include it even if it means always appending a 'Z'.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

If there's a gap in the documentation we can plug it, that said, if we want to be more explicit about the expression of UTC/Zulu time zone this can be treated as a simple bug fix and patch the timestamp_db file directly. Would that solve your concern?

Revision history for this message
Steve McLellan (sjmc7) wrote :

I would prefer to have the timezone explicit, but if the answer is that consumers should assume timestamps are in UTC, I can live with that and we'll make the change on our end.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

I guess the problem here is that we can't change the format now that we released the extension. We will need to live with it until we eg. implement microversioning that would allow us to apply such a change to new versions of the API.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/368682

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
status: Expired → In Progress
Changed in neutron:
milestone: none → newton-rc1
tags: added: api
Changed in neutron:
importance: Undecided → High
Changed in neutron:
milestone: newton-rc1 → ocata-1
tags: added: newton-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/368682
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=424a633fd985ad517a06dee1aeec805702d2e576
Submitter: Jenkins
Branch: master

commit 424a633fd985ad517a06dee1aeec805702d2e576
Author: Kevin Benton <email address hidden>
Date: Fri Sep 9 06:20:40 2016 -0700

    Include timezone in timestamp fields

    The Neutron 'created_at'/'updated_at' fields on API resources
    were inconsistent with other OpenStack projects because we did
    not include timezone information. This patch addressed that
    problem by adding the zulu time indicator onto the end of the
    fields.

    Because this could break clients expecting no timezone, this patch
    also eliminates the 'timestamp_core' and 'timestamp_ext' extensions
    and consolidates them into a new 'timestamp' extension. This makes
    the change discoverable via the API.

    This is assuming the current API development paradigm where
    extensions can come and go depending on the deployment and the client
    is expected to handle this by checking the loaded extensions.
    Once we decide extensions are permanent, this type of change will
    no longer be possible.

    Even though this is being proposed late in the cycle, it is better
    to get this change in before the release where we expose even more
    resources with incorrectly formatted timestamps.

    APIImpact
    Closes-Bug: #1561200
    Change-Id: I2ee2ed4c713d88345adc55b022feb95653eec663

Changed in neutron:
status: In Progress → Fix Released
Changed in neutron:
milestone: ocata-1 → newton-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/371751

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/371751
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8133f6e385b92c581974cfe3b4fb8fec19d716a4
Submitter: Jenkins
Branch: stable/newton

commit 8133f6e385b92c581974cfe3b4fb8fec19d716a4
Author: Kevin Benton <email address hidden>
Date: Fri Sep 9 06:20:40 2016 -0700

    Include timezone in timestamp fields

    The Neutron 'created_at'/'updated_at' fields on API resources
    were inconsistent with other OpenStack projects because we did
    not include timezone information. This patch addressed that
    problem by adding the zulu time indicator onto the end of the
    fields.

    Because this could break clients expecting no timezone, this patch
    also eliminates the 'timestamp_core' and 'timestamp_ext' extensions
    and consolidates them into a new 'timestamp' extension. This makes
    the change discoverable via the API.

    This is assuming the current API development paradigm where
    extensions can come and go depending on the deployment and the client
    is expected to handle this by checking the loaded extensions.
    Once we decide extensions are permanent, this type of change will
    no longer be possible.

    Even though this is being proposed late in the cycle, it is better
    to get this change in before the release where we expose even more
    resources with incorrectly formatted timestamps.

    (cherry picked from commit 424a633fd985ad517a06dee1aeec805702d2e576)

    APIImpact
    Closes-Bug: #1561200
    Change-Id: I2ee2ed4c713d88345adc55b022feb95653eec663

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0rc2

This issue was fixed in the openstack/neutron 9.0.0.0rc2 release candidate.

tags: removed: newton-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b1

This issue was fixed in the openstack/neutron 10.0.0.0b1 development milestone.

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
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.