update the vendored winrm release

This was updated to see if we can get at any error status from the
remote command and transport, which still is not available, but kept the
latest version since it fixes a couple race conditions.
This commit is contained in:
James Bardin 2018-03-15 12:30:27 -04:00
parent af132a186d
commit b214834834
2 changed files with 37 additions and 10 deletions

View File

@ -152,10 +152,20 @@ func (c *Client) RunWithString(command string, stdin string) (string, string, in
} }
var outWriter, errWriter bytes.Buffer var outWriter, errWriter bytes.Buffer
go io.Copy(&outWriter, cmd.Stdout) var wg sync.WaitGroup
go io.Copy(&errWriter, cmd.Stderr) wg.Add(2)
go func() {
defer wg.Done()
io.Copy(&outWriter, cmd.Stdout)
}()
go func() {
defer wg.Done()
io.Copy(&errWriter, cmd.Stderr)
}()
cmd.Wait() cmd.Wait()
wg.Wait()
return outWriter.String(), errWriter.String(), cmd.ExitCode(), cmd.err return outWriter.String(), errWriter.String(), cmd.ExitCode(), cmd.err
} }
@ -176,11 +186,24 @@ func (c Client) RunWithInput(command string, stdout, stderr io.Writer, stdin io.
return 1, err return 1, err
} }
go io.Copy(cmd.Stdin, stdin) var wg sync.WaitGroup
go io.Copy(stdout, cmd.Stdout) wg.Add(3)
go io.Copy(stderr, cmd.Stderr)
go func() {
defer wg.Done()
io.Copy(cmd.Stdin, stdin)
}()
go func() {
defer wg.Done()
io.Copy(stdout, cmd.Stdout)
}()
go func() {
defer wg.Done()
io.Copy(stderr, cmd.Stderr)
}()
cmd.Wait() cmd.Wait()
wg.Wait()
return cmd.ExitCode(), cmd.err return cmd.ExitCode(), cmd.err

14
vendor/vendor.json vendored
View File

@ -1983,16 +1983,20 @@
"revisionTime": "2016-06-08T18:30:07Z" "revisionTime": "2016-06-08T18:30:07Z"
}, },
{ {
"checksumSHA1": "8z5kCCFRsBkhXic9jxxeIV3bBn8=", "checksumSHA1": "dVQEUn5TxdIAXczK7rh6qUrq44Q=",
"path": "github.com/masterzen/winrm", "path": "github.com/masterzen/winrm",
"revision": "a2df6b1315e6fd5885eb15c67ed259e85854125f", "revision": "7e40f93ae939004a1ef3bd5ff5c88c756ee762bb",
"revisionTime": "2017-08-14T13:39:27Z" "revisionTime": "2018-02-24T16:03:50Z",
"version": "master",
"versionExact": "master"
}, },
{ {
"checksumSHA1": "XFSXma+KmkhkIPsh4dTd/eyja5s=", "checksumSHA1": "XFSXma+KmkhkIPsh4dTd/eyja5s=",
"path": "github.com/masterzen/winrm/soap", "path": "github.com/masterzen/winrm/soap",
"revision": "a2df6b1315e6fd5885eb15c67ed259e85854125f", "revision": "7e40f93ae939004a1ef3bd5ff5c88c756ee762bb",
"revisionTime": "2017-08-14T13:39:27Z" "revisionTime": "2018-02-24T16:03:50Z",
"version": "master",
"versionExact": "master"
}, },
{ {
"checksumSHA1": "rCffFCN6TpDAN3Jylyo8RFzhQ9E=", "checksumSHA1": "rCffFCN6TpDAN3Jylyo8RFzhQ9E=",