Merge lp:~cjwatson/swoffsite/tz-aware-last-modified-comparison into lp:swoffsite
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Gareth Woolridge |
Approved revision: | 47 |
Merged at revision: | 47 |
Proposed branch: | lp:~cjwatson/swoffsite/tz-aware-last-modified-comparison |
Merge into: | lp:swoffsite |
Diff against target: |
48 lines (+20/-4) 1 file modified
swoffsite/mirror.py (+20/-4) |
To merge this branch: | bzr merge lp:~cjwatson/swoffsite/tz-aware-last-modified-comparison |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gareth Woolridge | Approve | ||
Canonical IS Reviewers | Pending | ||
Review via email: mp+406282@code.launchpad.net |
Commit message
Do timezone-aware comparisons of last_modified from Swift.
Description of the change
Swift returns last_modified without a timezone indication, but RadosGW returns it with a trailing 'Z', so iso8601.parse_date parses it into a timezone-aware datetime which cannot be compared directly to the naive datetime returned by datetime.utcnow. Handle this difference: we now parse last_modified into an aware datetime in both cases and compare it only with other aware datetimes.
To post a comment you must log in.
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.