From 2696135b3b8d2708cd58062b9c84751982b2c111 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 3 Sep 2013 12:27:58 -0500 Subject: [PATCH] Display error during launch of accelerated daemon * also minor tweak to the # of retries in the connection attempt Fixes #4012 --- lib/ansible/runner/connection_plugins/accelerate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/connection_plugins/accelerate.py b/lib/ansible/runner/connection_plugins/accelerate.py index a466a3aad46..86294d82f78 100644 --- a/lib/ansible/runner/connection_plugins/accelerate.py +++ b/lib/ansible/runner/connection_plugins/accelerate.py @@ -74,7 +74,7 @@ class Connection(object): try: if not self.is_connected: # TODO: make the timeout and retries configurable? - tries = 10 + tries = 3 self.conn = socket.socket() self.conn.settimeout(30.0) while tries > 0: @@ -91,6 +91,8 @@ class Connection(object): if allow_ssh: vvv("Falling back to ssh to startup accelerated mode") res = self._execute_fb_module() + if not res.is_successful(): + raise errors.AnsibleError("Failed to launch the accelerated daemon on %s (reason: %s)" % (self.host,res.result.get('msg'))) return self.connect(allow_ssh=False) else: raise errors.AnsibleError("Failed to connect to %s:%s" % (self.host,self.fbport))