From 548a7288a90c49e9b50ccf197da307eae525b899 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 24 Jun 2015 01:00:22 -0700 Subject: [PATCH] Use BUFSIZE when putting file as well as fetching file. --- lib/ansible/plugins/connections/chroot.py | 2 +- lib/ansible/plugins/connections/jail.py | 2 +- lib/ansible/plugins/connections/zone.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/connections/chroot.py b/lib/ansible/plugins/connections/chroot.py index 7cc1afa718..cc5cee7803 100644 --- a/lib/ansible/plugins/connections/chroot.py +++ b/lib/ansible/plugins/connections/chroot.py @@ -121,7 +121,7 @@ class Connection(object): try: with open(in_path, 'rb') as in_file: try: - p = self._buffered_exec_command('dd of=%s' % out_path, None, stdin=in_file) + p = self._buffered_exec_command('dd of=%s bs=%s' % (out_path, BUFSIZE), None, stdin=in_file) except OSError: raise errors.AnsibleError("chroot connection requires dd command in the chroot") try: diff --git a/lib/ansible/plugins/connections/jail.py b/lib/ansible/plugins/connections/jail.py index 1e1f5b9307..d12318391c 100644 --- a/lib/ansible/plugins/connections/jail.py +++ b/lib/ansible/plugins/connections/jail.py @@ -143,7 +143,7 @@ class Connection(object): try: with open(in_path, 'rb') as in_file: try: - p = self._buffered_exec_command('dd of=%s' % out_path, None, stdin=in_file) + p = self._buffered_exec_command('dd of=%s bs=%s' % (out_path, BUFSIZE), None, stdin=in_file) except OSError: raise errors.AnsibleError("jail connection requires dd command in the jail") try: diff --git a/lib/ansible/plugins/connections/zone.py b/lib/ansible/plugins/connections/zone.py index 019cfb9a91..82256742a1 100644 --- a/lib/ansible/plugins/connections/zone.py +++ b/lib/ansible/plugins/connections/zone.py @@ -156,7 +156,7 @@ class Connection(object): try: with open(in_path, 'rb') as in_file: try: - p = self._buffered_exec_command('dd of=%s' % out_path, None, stdin=in_file) + p = self._buffered_exec_command('dd of=%s bs=%s' % (out_path, BUFSIZE), None, stdin=in_file) except OSError: raise errors.AnsibleError("jail connection requires dd command in the jail") try: