mirror of https://github.com/docker/compose.git
Validate that service names passed to Project.containers aren't bogus.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
This commit is contained in:
parent
417e6ce0c9
commit
2527ef8055
|
@ -274,6 +274,9 @@ class Project(object):
|
|||
service.remove_stopped(**options)
|
||||
|
||||
def containers(self, service_names=None, stopped=False, one_off=False):
|
||||
if service_names:
|
||||
# Will raise NoSuchService if one of the names is invalid
|
||||
self.get_services(service_names)
|
||||
containers = [
|
||||
Container.from_ps(self.client, container)
|
||||
for container in self.client.containers(
|
||||
|
|
Loading…
Reference in New Issue