From b1b93c7a226d9bcd557c0b2ed78bbee3d8bd916a Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Tue, 9 Oct 2018 21:18:32 -0400 Subject: [PATCH] [2.7] Clean up after ansible-connection if failure occurred in start() (#45930) * [2.7] Clean up after ansible-connection if failure occurred in start() (#45929) (cherry picked from commit 0d143ed) Co-authored-by: Nathaniel Case * Add changelog fragment --- bin/ansible-connection | 2 ++ .../fragments/ansible-connection-cleanup-when-failed.yaml | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/ansible-connection-cleanup-when-failed.yaml diff --git a/bin/ansible-connection b/bin/ansible-connection index 09656a55415..ac378a4d872 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -271,6 +271,8 @@ def main(): if rc == 0: process.run() + else: + process.shutdown() sys.exit(rc) diff --git a/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml b/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml new file mode 100644 index 00000000000..e57839d1fa7 --- /dev/null +++ b/changelogs/fragments/ansible-connection-cleanup-when-failed.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-connection - Clean up socket files if playbook aborted before connection is started.