Update vmware/govmomi godeps
This commit is contained in:
15
vendor/github.com/vmware/govmomi/object/network.go
generated
vendored
15
vendor/github.com/vmware/govmomi/object/network.go
generated
vendored
@@ -20,6 +20,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/vmware/govmomi/vim25"
|
||||
"github.com/vmware/govmomi/vim25/mo"
|
||||
"github.com/vmware/govmomi/vim25/types"
|
||||
)
|
||||
|
||||
@@ -34,12 +35,20 @@ func NewNetwork(c *vim25.Client, ref types.ManagedObjectReference) *Network {
|
||||
}
|
||||
|
||||
// EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this Network
|
||||
func (n Network) EthernetCardBackingInfo(_ context.Context) (types.BaseVirtualDeviceBackingInfo, error) {
|
||||
name := n.Name()
|
||||
func (n Network) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) {
|
||||
var e mo.Network
|
||||
|
||||
// Use Network.Name rather than Common.Name as the latter does not return the complete name if it contains a '/'
|
||||
// We can't use Common.ObjectName here either as we need the ManagedEntity.Name field is not set since mo.Network
|
||||
// has its own Name field.
|
||||
err := n.Properties(ctx, n.Reference(), []string{"name"}, &e)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
backing := &types.VirtualEthernetCardNetworkBackingInfo{
|
||||
VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{
|
||||
DeviceName: name,
|
||||
DeviceName: e.Name,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user