Implement restart command (Closes #98)

Signed-off-by: Mark Steve Samson <hello@marksteve.com>
This commit is contained in:
Mark Steve Samson 2014-08-08 11:22:33 +08:00
commit 9d55e01e2a
4 changed files with 21 additions and 0 deletions

View file

@ -89,6 +89,11 @@ class Service(object):
log.info("Killing %s..." % c.name)
c.kill(**options)
def restart(self, **options):
for c in self.containers():
log.info("Restarting %s..." % c.name)
c.restart(**options)
def scale(self, desired_num):
"""
Adjusts the number of containers to the specified number and ensures they are running.