Implement kill and rm

This commit is contained in:
Aanand Prasad 2013-12-20 16:53:07 +00:00
commit 81093627fe
4 changed files with 51 additions and 0 deletions

View file

@ -47,6 +47,15 @@ class Service(object):
for c in self.containers():
c.stop(**options)
def kill(self, **options):
for c in self.containers():
c.kill(**options)
def remove_stopped(self, **options):
for c in self.containers(stopped=True):
if not c.is_running:
c.remove(**options)
def create_container(self, one_off=False, **override_options):
"""
Create a container for this service. If the image doesn't exist, attempt to pull