Merge pull request #6666 from markpeek/markpeek-govmomi-0.6.2

vendor: Update dependency vmware/govmomi to v0.6.2
This commit is contained in:
James Nugent 2016-05-13 17:23:52 -04:00
commit 80d3c5bb63
7 changed files with 79 additions and 35 deletions

62
Godeps/Godeps.json generated
View File

@ -1,7 +1,7 @@
{
"ImportPath": "github.com/hashicorp/terraform",
"GoVersion": "go1.6",
"GodepVersion": "v63",
"GodepVersion": "v62",
"Packages": [
"./..."
],
@ -1266,78 +1266,78 @@
},
{
"ImportPath": "github.com/vmware/govmomi",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/find",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/list",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/object",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/property",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/session",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/task",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/debug",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/methods",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/mo",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/progress",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/soap",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/types",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/vmware/govmomi/vim25/xml",
"Comment": "v0.6.1",
"Rev": "18154e511bc8f6bc1fffe2e47d11ef4f1931a044"
"Comment": "v0.6.2",
"Rev": "9051bd6b44125d9472e0c148b5965692ab283d4a"
},
{
"ImportPath": "github.com/xanzy/go-cloudstack/cloudstack",

View File

@ -1,5 +1,13 @@
# changelog
### 0.6.2 (2016-05-11)
* Get complete file details in Datastore.Stat
* SOAP decoding fixes
* Add VirtualMachine.RemoveAllSnapshot
### 0.6.1 (2016-04-30)
* Fix mo.Entity interface

View File

@ -7,6 +7,7 @@ Alvaro Miranda <kikitux@gmail.com>
Amit Bathla <abathla@.vmware.com>
Andrew Chin <andrew@andrewtchin.com>
Arran Walker <arran.walker@zopa.com>
Austin Parker <aparker@apprenda.com>
Bob Killen <killen.bob@gmail.com>
Bruce Downs <bdowns@vmware.com>
Clint Greenwood <cgreenwood@vmware.com> <clint.greenwood@gmail.com>

View File

@ -315,7 +315,9 @@ func (d Datastore) Stat(ctx context.Context, file string) (types.BaseFileInfo, e
spec := types.HostDatastoreBrowserSearchSpec{
Details: &types.FileQueryFlags{
FileType: true,
FileOwner: types.NewBool(true), // TODO: omitempty is generated, but seems to be required
FileSize: true,
Modification: true,
FileOwner: types.NewBool(true),
},
MatchPattern: []string{path.Base(file)},
}

View File

@ -476,6 +476,21 @@ func (v VirtualMachine) CreateSnapshot(ctx context.Context, name string, descrip
return NewTask(v.c, res.Returnval), nil
}
// RemoveAllSnapshot removes all snapshots of a virtual machine
func (v VirtualMachine) RemoveAllSnapshot(ctx context.Context, consolidate *bool) (*Task, error) {
req := types.RemoveAllSnapshots_Task{
This: v.Reference(),
Consolidate: consolidate,
}
res, err := methods.RemoveAllSnapshots_Task(ctx, v.c, &req)
if err != nil {
return nil, err
}
return NewTask(v.c, res.Returnval), nil
}
// RevertToSnapshot reverts to a named snapshot
func (v VirtualMachine) RevertToSnapshot(ctx context.Context, name string, suppressPowerOn bool) (*Task, error) {
var o mo.VirtualMachine

View File

@ -189,12 +189,20 @@ func assignValue(val reflect.Value, fi []int, pv reflect.Value) {
npv := reflect.New(pt)
npv.Elem().Set(pv)
pv = npv
pt = pv.Type()
} else {
panic(fmt.Sprintf("type %s doesn't implement %s", pt.Name(), rt.Name()))
}
}
if pt.AssignableTo(rt) {
rv.Set(pv)
} else if rt.ConvertibleTo(pt) {
rv.Set(pv.Convert(rt))
} else {
panic(fmt.Sprintf("cannot assign %s (%s) to %s (%s)", rt.Name(), rt.Kind(), pt.Name(), pt.Kind()))
}
return
}

View File

@ -271,9 +271,19 @@ var (
// Find reflect.Type for an element's type attribute.
func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type {
t := ""
for _, a := range start.Attr {
for i, a := range start.Attr {
if a.Name == xmlSchemaInstance {
t = a.Value
// HACK: ensure xsi:type is last in the list to avoid using that value for
// a "type" attribute, such as ManagedObjectReference.Type for example.
// Note that xsi:type is already the last attribute in VC/ESX responses.
// This is only an issue with govmomi simulator generated responses.
// Proper fix will require finding a few needles in this xml package haystack.
x := len(start.Attr) - 1
if i != x {
start.Attr[i] = start.Attr[x]
start.Attr[x] = a
}
break
}
}