Fix py3 issue in wait_for_connection (#37646)
(cherry picked from commit 6c3e565ba3
)
This commit is contained in:
parent
dff97aa252
commit
07449d7e3d
1 changed files with 2 additions and 1 deletions
|
@ -54,11 +54,12 @@ class ActionModule(ActionBase):
|
||||||
display.debug("wait_for_connection: %s success" % what_desc)
|
display.debug("wait_for_connection: %s success" % what_desc)
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
error = e # PY3 compatibility to store exception for use outside of this block
|
||||||
if what_desc:
|
if what_desc:
|
||||||
display.debug("wait_for_connection: %s fail (expected), retrying in %d seconds..." % (what_desc, sleep))
|
display.debug("wait_for_connection: %s fail (expected), retrying in %d seconds..." % (what_desc, sleep))
|
||||||
time.sleep(sleep)
|
time.sleep(sleep)
|
||||||
|
|
||||||
raise TimedOutException("timed out waiting for %s: %s" % (what_desc, e))
|
raise TimedOutException("timed out waiting for %s: %s" % (what_desc, error))
|
||||||
|
|
||||||
def run(self, tmp=None, task_vars=None):
|
def run(self, tmp=None, task_vars=None):
|
||||||
if task_vars is None:
|
if task_vars is None:
|
||||||
|
|
Loading…
Reference in a new issue