[ARVADOS] updated: 679ea52a117414fc33768aac887615f9b701fdf8
git at public.curoverse.com
git at public.curoverse.com
Wed Jun 10 11:27:11 EDT 2015
Summary of changes:
sdk/python/arvados/commands/keepdocker.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
via 679ea52a117414fc33768aac887615f9b701fdf8 (commit)
from 54cfeb7cbf6d5716ddf5399400521545defb0a00 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 679ea52a117414fc33768aac887615f9b701fdf8
Author: Brett Smith <brett at curoverse.com>
Date: Wed Jun 10 11:24:38 2015 -0400
5790: Fix PySDK Docker image listing comparing ints and datetimes.
Closes #5790.
diff --git a/sdk/python/arvados/commands/keepdocker.py b/sdk/python/arvados/commands/keepdocker.py
index db77dc8..e48a6d1 100644
--- a/sdk/python/arvados/commands/keepdocker.py
+++ b/sdk/python/arvados/commands/keepdocker.py
@@ -21,6 +21,7 @@ import arvados.commands._util as arv_cmd
import arvados.commands.put as arv_put
import ciso8601
+EARLIEST_DATETIME = datetime.datetime(datetime.MINYEAR, 1, 1, 0, 0, 0)
STAT_CACHE_ERRORS = (IOError, OSError, ValueError)
DockerImage = collections.namedtuple(
@@ -175,7 +176,7 @@ def docker_link_sort_key(link):
image_timestamp = ciso8601.parse_datetime_unaware(
link['properties']['image_timestamp'])
except (KeyError, ValueError):
- image_timestamp = 0
+ image_timestamp = EARLIEST_DATETIME
return (image_timestamp,
ciso8601.parse_datetime_unaware(link['created_at']))
@@ -188,9 +189,10 @@ def _get_docker_links(api_client, num_retries, **kwargs):
return links
def _new_image_listing(link, dockerhash, repo='<none>', tag='<none>'):
+ timestamp_index = 1 if (link['_sort_key'][0] is EARLIEST_DATETIME) else 0
return {
'_sort_key': link['_sort_key'],
- 'timestamp': link['_sort_key'][0] or link['_sort_key'][1],
+ 'timestamp': link['_sort_key'][timestamp_index],
'collection': link['head_uuid'],
'dockerhash': dockerhash,
'repo': repo,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list