Fix inspect time do not match required format
When execute zun list, docker-py inspect may return start time not in required format, container.docker.driver: format_status_detail throw exception. Since we do not need the micro seconds field, trim the time string to [:19] and discard the microseconds field in the format string. Change-Id: Ib3da2551d65d67d18ab8293ead0de34818a4f301 Close-bug: #1670964
This commit is contained in:
parent
14c4b44749
commit
f5c2f0da75
|
@ -138,8 +138,8 @@ class DockerDriver(driver.ContainerDriver):
|
|||
|
||||
def format_status_detail(self, status_time):
|
||||
try:
|
||||
st = datetime.datetime.strptime((status_time[:-4]),
|
||||
'%Y-%m-%dT%H:%M:%S.%f')
|
||||
st = datetime.datetime.strptime((status_time[:19]),
|
||||
'%Y-%m-%dT%H:%M:%S')
|
||||
except ValueError as e:
|
||||
LOG.exception(_LE("Error on parse {} : {}").format(status_time, e))
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue