parse_datetime_as_naive should only be used in instances where we want to parse a string that we know contains timezone info AND we do not want to include it in the resulting datetime object. Otherwise, parse_datetime is preferred for parsing strings with or without timezone info.
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>
if record["output_uuid"]:
if self.arvrunner.trash_intermediate or self.arvrunner.intermediate_output_ttl:
# Compute the trash time to avoid requesting the collection record.
- trash_at = ciso8601.parse_datetime_as_naive(record["modified_at"]) + datetime.timedelta(0, self.arvrunner.intermediate_output_ttl)
+ trash_at = ciso8601.parse_datetime(record["modified_at"]) + datetime.timedelta(0, self.arvrunner.intermediate_output_ttl)
aftertime = " at %s" % trash_at.strftime("%Y-%m-%d %H:%M:%S UTC") if self.arvrunner.intermediate_output_ttl else ""
orpart = ", or" if self.arvrunner.trash_intermediate and self.arvrunner.intermediate_output_ttl else ""
oncomplete = " upon successful completion of the workflow" if self.arvrunner.trash_intermediate else ""
Docker metadata links to sort them from least to most preferred.
"""
try:
- image_timestamp = ciso8601.parse_datetime_as_naive(
+ image_timestamp = ciso8601.parse_datetime(
link['properties']['image_timestamp'])
except (KeyError, ValueError):
image_timestamp = EARLIEST_DATETIME
try:
- created_timestamp = ciso8601.parse_datetime_as_naive(link['created_at'])
+ created_timestamp = ciso8601.parse_datetime(link['created_at'])
except ValueError:
created_timestamp = None
return (image_timestamp, created_timestamp)
if not t:
return 0
try:
- return calendar.timegm(ciso8601.parse_datetime_as_naive(t).timetuple())
+ return calendar.timegm(ciso8601.parse_datetime(t).timetuple())
except (TypeError, ValueError):
return 0