Rework 'fig up' to use recreate_containers()

This commit is contained in:
Aanand Prasad 2014-01-15 13:25:40 +00:00
parent f5f9357736
commit 5db6c9f51b

View File

@ -220,14 +220,18 @@ class TopLevelCommand(Command):
""" """
detached = options['-d'] detached = options['-d']
self.project.create_containers(service_names=options['SERVICE']) (old, new) = self.project.recreate_containers(service_names=options['SERVICE'])
containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
if not detached: if not detached:
print("Attaching to", list_containers(containers)) to_attach = [c for (s, c) in new]
log_printer = LogPrinter(containers) print("Attaching to", list_containers(to_attach))
log_printer = LogPrinter(to_attach)
self.project.start(service_names=options['SERVICE']) for (service, container) in new:
service.start_container(container)
for (service, container) in old:
container.remove()
if not detached: if not detached:
try: try: