Skip to content

Commit

Permalink
graceful parsing of finished_at, the same as start date
Browse files Browse the repository at this point in the history
Fixes #148

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
  • Loading branch information
TomasTomecek committed Oct 4, 2019
1 parent 239b486 commit ad3e194
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sen/docker_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,12 @@ def finished_at(self):
f = f[:26]
if f == "0001-01-01T00:00:00Z":
return DINOSAUR_TIME
finished_at = datetime.datetime.strptime(f, ISO_DATETIME_PARSE_STRING)
f = f.replace("Z", "0")
try:
finished_at = datetime.datetime.strptime(f, ISO_DATETIME_PARSE_STRING)
except ValueError as ex:
logger.error("unable to parse datetime %s: %s", f, ex)
return DINOSAUR_TIME
return finished_at

@property
Expand Down

0 comments on commit ad3e194

Please sign in to comment.