mirror of
https://github.com/docker/compose.git
synced 2025-07-21 20:54:32 +02:00
Merge pull request #1526 from aanand/remove-start-or-create-containers
Remove Service.start_or_create_containers()
This commit is contained in:
commit
38a11c4c28
@ -394,21 +394,6 @@ class Service(object):
|
|||||||
container.start()
|
container.start()
|
||||||
return container
|
return container
|
||||||
|
|
||||||
def start_or_create_containers(
|
|
||||||
self,
|
|
||||||
insecure_registry=False,
|
|
||||||
do_build=True):
|
|
||||||
containers = self.containers(stopped=True)
|
|
||||||
|
|
||||||
if not containers:
|
|
||||||
new_container = self.create_container(
|
|
||||||
insecure_registry=insecure_registry,
|
|
||||||
do_build=do_build,
|
|
||||||
)
|
|
||||||
return [self.start_container(new_container)]
|
|
||||||
else:
|
|
||||||
return [self.start_container_if_stopped(c) for c in containers]
|
|
||||||
|
|
||||||
def config_hash(self):
|
def config_hash(self):
|
||||||
return json_hash(self.config_dict())
|
return json_hash(self.config_dict())
|
||||||
|
|
||||||
|
@ -501,10 +501,10 @@ class ServiceTest(DockerClientTestCase):
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
def test_start_with_image_id(self):
|
def test_create_with_image_id(self):
|
||||||
# Image id for the current busybox:latest
|
# Image id for the current busybox:latest
|
||||||
service = self.create_service('foo', image='8c2e06607696')
|
service = self.create_service('foo', image='8c2e06607696')
|
||||||
self.assertTrue(service.start_or_create_containers())
|
service.create_container()
|
||||||
|
|
||||||
def test_scale(self):
|
def test_scale(self):
|
||||||
service = self.create_service('web')
|
service = self.create_service('web')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user