Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Add workaround for Python 2.6. #9

Merged
merged 2 commits into from
Dec 12, 2014
Merged

Add workaround for Python 2.6. #9

merged 2 commits into from
Dec 12, 2014

Conversation

tomstockton
Copy link
Contributor

Python 2.6 does not include the total_seconds method for datetime.timedelta

https://docs.python.org/2/library/datetime.html#datetime.timedelta.total_seconds

@@ -53,7 +53,9 @@ function ElapsedTime() {
from datetime import datetime,timedelta
now = datetime.utcnow()
exited = datetime.strptime("${1}".replace("Z","").split('.')[0], "%Y-%m-%dT%H:%M:%S")
print int((now - exited).total_seconds())
difference = now - exited
differenceTotalSeconds = (difference.microseconds + (difference.seconds + difference.days*24*3600) * 1e6) / 1e6
Copy link
Member

Choose a reason for hiding this comment

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

I think we can disregard microseconds accuracy and just make this

differenceTotalSeconds = difference.seconds + difference.days*24*3600

@mbruggmann
Copy link
Member

Minor comment only, otherwise 👍 Thanks!

@tomstockton
Copy link
Contributor Author

Thanks for the feedback, PR updated.

mbruggmann added a commit that referenced this pull request Dec 12, 2014
Add workaround for Python 2.6.
@mbruggmann mbruggmann merged commit 1b5d533 into spotify:master Dec 12, 2014
davidxia pushed a commit that referenced this pull request May 23, 2018
* bump docker version and fix binary mv
* add volume cleanup
* mention volumes in readme
* keep docker-gc backward-compatibility
* improve remove volumes logic
* this would probably be a feature
* change back to original docker version
* exclude volumes removal
* add VOLUME_DELETE_ONLY_DRIVER
* fix typos (#6)
* exclude volumes file defaults to null (#7)
* it should be local, not locale (#8)
* Add dangling images to list of all images. (#9)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants