From 8a121fd6ae378106b9b59318c3bc44a95d9e3ea7 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Thu, 19 Jun 2014 16:19:23 -0500 Subject: [PATCH] Squeeze a few more bytes out of put_file script. --- lib/ansible/runner/connection_plugins/winrm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/runner/connection_plugins/winrm.py b/lib/ansible/runner/connection_plugins/winrm.py index 6353d9f4c8..e9ee8692f6 100644 --- a/lib/ansible/runner/connection_plugins/winrm.py +++ b/lib/ansible/runner/connection_plugins/winrm.py @@ -158,11 +158,11 @@ class Connection(object): in_size = os.path.getsize(in_path) script_template = ''' $s = [System.IO.File]::OpenWrite("%s"); - $s.Seek(%d, [System.IO.SeekOrigin]::Begin) | Out-Null; + [void]$s.Seek(%d, [System.IO.SeekOrigin]::Begin); $b = [System.Convert]::FromBase64String("%s"); - $s.Write($b, 0, $b.length) | Out-Null; - $s.SetLength(%d) | Out-Null; - $s.Close() | Out-Null; + [void]$s.Write($b, 0, $b.length); + [void]$s.SetLength(%d); + [void]$s.Close(); ''' # Determine max size of data we can pass per command. script = script_template % (powershell._escape(out_path), in_size, '', in_size)