time comparison filter didn't support time zone offset

Bug #1882622 reported by wanghao
This bug affects 1 person
Affects Status Importance Assigned to Milestone
In Progress

Bug Description

Cinder has supported filtering volumes by time comparison operators.
The time format is following ISO 8601. But there is small bug that didn't consider the time zone offset well in time string.
That will impact the result of filtering volumes.

wanghao (wanghao749)
Changed in cinder:
assignee: nobody → wanghao (wanghao749)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/734415

Changed in cinder:
status: New → In Progress
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

I don't believe this is a bug. Cinder handles everything in UTC. It was never intended to include the timezone offset in the filtering feature.

Revision history for this message
wanghao (wanghao749) wrote :

I found this issue when I was working on time comparison filters for snapshots. I got the updated_at time from snapshot object, it's "datetime.datetime(2020, 7, 6, 3, 47, 47, 24856, tzinfo=datetime.timezone.utc)", and when I passed this time to getting snapshots url, the query string will be '/v3/snapshots?updated_at=gt:2020-07-06 03:47:47.024856+00:00'. Of course, it UTC time. But I think since we follow the ISO 8601 time format, that's huge possibility that user pass the time string with timezone offset and now Cinder will raise an exception for it. Since we missed this feature in U cycle, (sorry my fault), we must fix it in U and V cycles both. That's why I proposed a bug fixing here.

tags: added: filter time volume zone
Changed in cinder:
importance: Undecided → Low
wanghao (wanghao749)
description: updated
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.