Merge pull request #1835 from aanand/fix-crash-when-container-has-no-name

Ignore containers that don't have a name
(cherry picked from commit 4e12ce39b3)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Ben Firshman 2015-08-10 18:50:00 +01:00 committed by Aanand Prasad
commit 74b4fb89bb
6 changed files with 64 additions and 11 deletions

View file

@ -310,11 +310,11 @@ class Project(object):
else:
service_names = self.service_names
containers = [
containers = filter(None, [
Container.from_ps(self.client, container)
for container in self.client.containers(
all=stopped,
filters={'label': self.labels(one_off=one_off)})]
filters={'label': self.labels(one_off=one_off)})])
def matches_service_names(container):
return container.labels.get(LABEL_SERVICE) in service_names