Merge pull request #6261 from DanHam/fix-6240-update-winrm

Update github.com/masterzen/winrm & github.com/masterzen/winrm/soap to latest
This commit is contained in:
M. Marsh 2018-05-24 15:38:38 -07:00 committed by GitHub
commit 4dc8dd3368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 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
go io.Copy(&outWriter, cmd.Stdout)
go io.Copy(&errWriter, cmd.Stderr)
var wg sync.WaitGroup
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()
wg.Wait()
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
}
go io.Copy(cmd.Stdin, stdin)
go io.Copy(stdout, cmd.Stdout)
go io.Copy(stderr, cmd.Stderr)
var wg sync.WaitGroup
wg.Add(3)
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()
wg.Wait()
return cmd.ExitCode(), cmd.err

10
vendor/vendor.json vendored
View File

@ -989,16 +989,16 @@
"revision": "95ba30457eb1121fa27753627c774c7cd4e90083"
},
{
"checksumSHA1": "8z5kCCFRsBkhXic9jxxeIV3bBn8=",
"checksumSHA1": "dVQEUn5TxdIAXczK7rh6qUrq44Q=",
"path": "github.com/masterzen/winrm",
"revision": "a2df6b1315e6fd5885eb15c67ed259e85854125f",
"revisionTime": "2017-08-14T13:39:27Z"
"revision": "7e40f93ae939004a1ef3bd5ff5c88c756ee762bb",
"revisionTime": "2018-02-24T16:03:50Z"
},
{
"checksumSHA1": "XFSXma+KmkhkIPsh4dTd/eyja5s=",
"path": "github.com/masterzen/winrm/soap",
"revision": "a2df6b1315e6fd5885eb15c67ed259e85854125f",
"revisionTime": "2017-08-14T13:39:27Z"
"revision": "7e40f93ae939004a1ef3bd5ff5c88c756ee762bb",
"revisionTime": "2018-02-24T16:03:50Z"
},
{
"checksumSHA1": "NkbetqlpWBi3gP08JDneC+axTKw=",