def _image_exists(self, client, name): # Make sure the image exists for image in client.images(): for tag in image['RepoTags']: if ':' in name and tag == name: return True if tag.startswith(name + ':'): return True return False
def _image_exists(self, client): # Make sure the container exists for image in client.images(): for tag in image['RepoTags']: if ':' in self.image and tag == self.image: return True if tag.startswith(self.image + ':'): return True return False