summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ansible/modules/utilities/logic/wait_for.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ansible/modules/utilities/logic/wait_for.py b/lib/ansible/modules/utilities/logic/wait_for.py
index 0b93f31091..c42a2b3067 100644
--- a/lib/ansible/modules/utilities/logic/wait_for.py
+++ b/lib/ansible/modules/utilities/logic/wait_for.py
@@ -552,7 +552,8 @@ def main():
# Shutdown the client socket
try:
s.shutdown(socket.SHUT_RDWR)
- except socket.error as e:
+ except socket.error:
+ e = get_exception()
if e.errno != errno.ENOTCONN:
raise
# else, the server broke the connection on its end, assume it's not ready
@@ -565,7 +566,8 @@ def main():
# Connection established, success!
try:
s.shutdown(socket.SHUT_RDWR)
- except socket.error as e:
+ except socket.error:
+ e = get_exception()
if e.errno != errno.ENOTCONN:
raise
# else, the server broke the connection on its end, assume it's not ready