Fix the kolla_docker issue with docker 1.12

After docker 1.12, the RepoTags will be None rather than [] in the
image list API. This PS will handle the both case.

Change-Id: Ie2da44b44229c2f190550755b50876f607f9cc0c
Closes-Bug: #1608358
(cherry picked from commit ae34973d35)
This commit is contained in:
Jeffrey Zhang 2016-08-01 13:35:25 +08:00
parent b90184e224
commit 7ead6ba4a3
1 changed files with 4 additions and 1 deletions

View File

@ -228,7 +228,10 @@ class DockerWorker(object):
def check_image(self):
find_image = ':'.join(self.parse_image())
for image in self.dc.images():
for image_name in image['RepoTags']:
repo_tags = image.get('RepoTags')
if not repo_tags:
continue
for image_name in repo_tags:
if image_name == find_image:
return image