Skip to content

Commit

Permalink
Fix docker support for some version of docker-py on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Apr 19, 2016
1 parent 6347152 commit 10c8fc3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pysos/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def total_memory(self, image='ubuntu'):

def _is_image_avail(self, image):
images = sum([x['RepoTags'] for x in self.client.images()], [])
# some earlier version of docker-py returns docker.io/ for global repositories
images = [x[10:] if x.startswith('docker.io/') else x for x in images]
return (':' in image and image in images) or \
(':' not in image and '{}:latest'.format(image) in images)

Expand Down

0 comments on commit 10c8fc3

Please sign in to comment.