Merge pull request #4943 from chouseknecht/devel
Improve error handling in docker_service module
This commit is contained in:
commit
16c9597ca7
1 changed files with 3 additions and 3 deletions
|
@ -655,7 +655,7 @@ class ContainerManager(DockerBaseClass):
|
||||||
detached=detached,
|
detached=detached,
|
||||||
remove_orphans=self.remove_orphans)
|
remove_orphans=self.remove_orphans)
|
||||||
except Exception as exc:
|
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:
|
if self.stopped:
|
||||||
result.update(self.cmd_stop(service_names))
|
result.update(self.cmd_stop(service_names))
|
||||||
|
@ -804,7 +804,7 @@ class ContainerManager(DockerBaseClass):
|
||||||
try:
|
try:
|
||||||
self.project.down(image_type, self.remove_volumes, self.remove_orphans)
|
self.project.down(image_type, self.remove_volumes, self.remove_orphans)
|
||||||
except Exception as exc:
|
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
|
return result
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ class ContainerManager(DockerBaseClass):
|
||||||
result['actions'][service.name]['scale'] = self.scale[service.name] - len(containers)
|
result['actions'][service.name]['scale'] = self.scale[service.name] - len(containers)
|
||||||
if not self.check_mode:
|
if not self.check_mode:
|
||||||
try:
|
try:
|
||||||
service.scale(self.scale[service.name])
|
service.scale(int(self.scale[service.name]))
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
self.client.fail("Error scaling %s - %s" % (service.name, str(exc)))
|
self.client.fail("Error scaling %s - %s" % (service.name, str(exc)))
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue