godeps: update vmware/govmomi

Update required to continue work on #64021

- The govmomi tag API changed

- Pulling in the new vapi/simulator package for testing the VCP Zones impl
This commit is contained in:
Doug MacEachern
2018-08-22 11:11:11 -07:00
parent c0be4cc09c
commit 5816a8bc18
21 changed files with 1853 additions and 930 deletions

View File

@@ -21,6 +21,7 @@ import (
"io"
"net/http"
"net/http/httputil"
"strings"
"sync/atomic"
"time"
@@ -69,6 +70,14 @@ func (d *debugRoundTrip) newFile(suffix string) io.WriteCloser {
return debug.NewFile(fmt.Sprintf("%d-%04d.%s", d.cn, d.rn, suffix))
}
func (d *debugRoundTrip) ext(h http.Header) string {
ext := "xml"
if strings.Contains(h.Get("Content-Type"), "/json") {
ext = "json"
}
return ext
}
func (d *debugRoundTrip) debugRequest(req *http.Request) {
if d == nil {
return
@@ -83,7 +92,7 @@ func (d *debugRoundTrip) debugRequest(req *http.Request) {
wc.Close()
// Capture body
wc = d.newFile("req.xml")
wc = d.newFile("req." + d.ext(req.Header))
req.Body = newTeeReader(req.Body, wc)
// Delay closing until marked done
@@ -104,7 +113,7 @@ func (d *debugRoundTrip) debugResponse(res *http.Response) {
wc.Close()
// Capture body
wc = d.newFile("res.xml")
wc = d.newFile("res." + d.ext(res.Header))
res.Body = newTeeReader(res.Body, wc)
// Delay closing until marked done