From 03a0ea682b77ed406c88b3297768e64e07c2e8ef Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 12 Oct 2017 12:58:25 -0400 Subject: restored 2.4/2.5 compat --- lib/ansible/modules/utilities/logic/wait_for.py | 6 ++++-- 1 file 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 -- cgit v1.2.1