Skip to content

Conversation

aanand
Copy link
Contributor

@aanand aanand commented Jul 20, 2015

I can't make the test suite pass on a machine that's not set to UTC, because the datetime_to_timestamp() utility function performs date arithmetic under that assumption, causing one of the events() tests to fail.

I've changed it so that it always expects a UTC datetime, and made sure we pass one in in the test.

I also removed the default value for its argument, because (a) it wasn't used anywhere and (b) it was being set to to datetime.now() at file load time, which almost certainly isn't what the user wants.

@shin- shin- modified the milestone: 1.3.1 Jul 20, 2015
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break if the dt parameter is unspecified. Not that it ever should - I say we remove the default value altogether, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I thought that's what I did, but it clearly isn't. Updated.

@aanand aanand force-pushed the fix-timestamp-conversion branch from 73e283f to 657420a Compare July 21, 2015 09:49
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@shin-
Copy link
Contributor

shin- commented Jul 21, 2015

Thanks, lgtm!

shin- added a commit that referenced this pull request Jul 21, 2015
Enforce UTC datetimes in arguments to `events()`
@shin- shin- merged commit 42b712d into docker:master Jul 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants