From b59f376f3c54d4ba35f31436955df31d8b5827d8 Mon Sep 17 00:00:00 2001 From: Luther Monson Date: Wed, 13 Nov 2019 13:54:58 -0700 Subject: [PATCH] removing deprecated ds.URL --- drivers/vmwarevsphere/cloudinit.go | 6 +----- drivers/vmwarevsphere/create.go | 5 +---- drivers/vmwarevsphere/utils.go | 5 +---- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/vmwarevsphere/cloudinit.go b/drivers/vmwarevsphere/cloudinit.go index eee9b77277..0f864066c4 100644 --- a/drivers/vmwarevsphere/cloudinit.go +++ b/drivers/vmwarevsphere/cloudinit.go @@ -87,17 +87,13 @@ func (d *Driver) uploadCloudInitIso(vm *object.VirtualMachine, dc *object.Datace return err } - dsurl, err := ds.URL(d.getCtx(), dc, filepath.Join(path, isoName)) - if err != nil { - return err - } - p := soap.DefaultUpload c, err := d.getSoapClient() if err != nil { return err } + dsurl := ds.NewURL(filepath.Join(path, isoName)) if err = c.Client.UploadFile(d.getCtx(), d.ResolveStorePath(filepath.Join(isoDir, isoName)), dsurl, &p); err != nil { return err } diff --git a/drivers/vmwarevsphere/create.go b/drivers/vmwarevsphere/create.go index 5e11c0c2b0..b6abb16b8d 100644 --- a/drivers/vmwarevsphere/create.go +++ b/drivers/vmwarevsphere/create.go @@ -210,10 +210,7 @@ func (d *Driver) createLegacy() error { return err } - dsurl, err := ds.URL(d.getCtx(), d.datacenter, filepath.Join(vmPath, isoFilename)) - if err != nil { - return err - } + dsurl := ds.NewURL(filepath.Join(vmPath, isoFilename)) p := soap.DefaultUpload if err = c.Client.UploadFile(d.getCtx(), d.ISO, dsurl, &p); err != nil { return err diff --git a/drivers/vmwarevsphere/utils.go b/drivers/vmwarevsphere/utils.go index 0893333672..1747f11444 100644 --- a/drivers/vmwarevsphere/utils.go +++ b/drivers/vmwarevsphere/utils.go @@ -142,16 +142,13 @@ func (d *Driver) recommendDatastore(sp *object.StoragePod, spec *types.VirtualMa return nil, err } - datastore := object.NewDatastore(c.Client, ds) - datastore.InventoryPath = mds.Name - // Apply recommendation to eligible disks for _, disk := range disks { backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) backing.Datastore = &ds } - return datastore, nil + return d.finder.Datastore(d.getCtx(), mds.Name) } func (d *Driver) publicSSHKeyPath() string {