Fixing up error handling for fetch_file ops in connection plugins

* enable batch mode (configurable with a config option, on by default)
  for sftp transfers, so we can catch errors more easily
* general cleanup in the local connection plugin and fetch action plugin

Fixes #11612
This commit is contained in:
James Cammarata 2015-07-22 14:25:47 -04:00
parent 993ce592b1
commit 7a9916422a
5 changed files with 20 additions and 7 deletions

View file

@ -472,6 +472,12 @@ class Connection(ConnectionBase):
indata = None
else:
cmd.append('sftp')
# sftp batch mode allows us to correctly catch failed transfers,
# but can be disabled if for some reason the client side doesn't
# support the option
if C.DEFAULT_SFTP_BATCH_MODE:
cmd.append('-b')
cmd.append('-')
cmd.extend(self._common_args)
cmd.append(self.host)
indata = "get {0} {1}\n".format(in_path, out_path)