Remove service.start_container()
It has been an unnecessary wrapper around container.start() for a little while now, so we can call it directly. Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
19a41997c2
commit
3d9e3d0877
5 changed files with 22 additions and 26 deletions
|
|
@ -448,7 +448,7 @@ class TopLevelCommand(DocoptCommand):
|
|||
raise e
|
||||
|
||||
if detach:
|
||||
service.start_container(container)
|
||||
container.start()
|
||||
print(container.name)
|
||||
else:
|
||||
dockerpty.start(project.client, container.id, interactive=not options['-T'])
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ class Service(object):
|
|||
if should_attach_logs:
|
||||
container.attach_log_stream()
|
||||
|
||||
self.start_container(container)
|
||||
container.start()
|
||||
|
||||
return [container]
|
||||
|
||||
|
|
@ -457,21 +457,16 @@ class Service(object):
|
|||
)
|
||||
if attach_logs:
|
||||
new_container.attach_log_stream()
|
||||
self.start_container(new_container)
|
||||
new_container.start()
|
||||
container.remove()
|
||||
return new_container
|
||||
|
||||
def start_container_if_stopped(self, container, attach_logs=False):
|
||||
if container.is_running:
|
||||
return container
|
||||
else:
|
||||
if not container.is_running:
|
||||
log.info("Starting %s" % container.name)
|
||||
if attach_logs:
|
||||
container.attach_log_stream()
|
||||
return self.start_container(container)
|
||||
|
||||
def start_container(self, container):
|
||||
container.start()
|
||||
container.start()
|
||||
return container
|
||||
|
||||
def remove_duplicate_containers(self, timeout=DEFAULT_TIMEOUT):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue