def save_remote_file(path, data): ''' Save data to the remote file. ''' fd = StringIO(data) put(fd, path) return fd.getvalue()