Capture IOErrors uploading files and point to full disk where the mismatch size is 0.
@@ -197,8 +197,17 @@ def _put_file(host, filename_or_io, remote_location):
with get_file_io(filename_or_io) as file_io:
# Upload it via SFTP
sftp = _get_sftp_connection(host)
+
+ try:
sftp.putfo(file_io, remote_location)
+ except IOError as e:
+ # IO mismatch errors might indicate full disks
+ if e.message.startswith('size mismatch in put! 0 !='):
+ raise IOError('{0} (disk may be full)'.format(e.message))
+
+ raise
+
def put_file(
state, host, filename_or_io, remote_file,
