Fix a bug with a remote command and script runner not closing SSH
connections after the action execution has finished.
@@ -144,6 +144,12 @@ class BaseParallelSSHRunner(ActionRunner, ShellRunnerMixin):
self._parallel_ssh_client = ParallelSSHClient(**client_kwargs)
+ def post_run(self, status, result):
+ super(BaseParallelSSHRunner, self).post_run(status=status, result=result)
+
+ # Ensure we close the connection when the action execution finishes
+ self._parallel_ssh_client.close()
+
def _is_private_key_material(self, private_key):
return private_key and REMOTE_RUNNER_PRIVATE_KEY_HEADER in private_key.lower()
