From 5ab1a6f88dea24eafa6e61114e5687fc7f2b7704 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 20 Sep 2016 09:45:26 -0400 Subject: [PATCH 1/2] Make project start and stop error handling more resilient, and improve message text. --- cloud/docker/docker_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/docker/docker_service.py b/cloud/docker/docker_service.py index afb2e757b68..8158de7e517 100644 --- a/cloud/docker/docker_service.py +++ b/cloud/docker/docker_service.py @@ -655,7 +655,7 @@ class ContainerManager(DockerBaseClass): detached=detached, remove_orphans=self.remove_orphans) except Exception as exc: - self.client.fail("Error bring %s up - %s" % (self.project.name, str(exc))) + self.client.fail("Error starting project - %s" % str(exc)) if self.stopped: result.update(self.cmd_stop(service_names)) @@ -804,7 +804,7 @@ class ContainerManager(DockerBaseClass): try: self.project.down(image_type, self.remove_volumes, self.remove_orphans) except Exception as exc: - self.client.fail("Error bringing %s down - %s" % (self.project.name, str(exc))) + self.client.fail("Error stopping project - %s" % str(exc)) return result From 4a560d4a155fe4de590daae250b746e1b801cb67 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 20 Sep 2016 10:29:27 -0400 Subject: [PATCH 2/2] Cast scale value to int. Fixes #4592. --- cloud/docker/docker_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/docker/docker_service.py b/cloud/docker/docker_service.py index 8158de7e517..db4352c9306 100644 --- a/cloud/docker/docker_service.py +++ b/cloud/docker/docker_service.py @@ -877,7 +877,7 @@ class ContainerManager(DockerBaseClass): result['actions'][service.name]['scale'] = self.scale[service.name] - len(containers) if not self.check_mode: try: - service.scale(self.scale[service.name]) + service.scale(int(self.scale[service.name])) except Exception as exc: self.client.fail("Error scaling %s - %s" % (service.name, str(exc))) return result