Skip to content

Commit

Permalink
removing deprecated ds.URL
Browse files Browse the repository at this point in the history
  • Loading branch information
luthermonson authored and Alena Prokharchyk committed Nov 13, 2019
1 parent 448df10 commit b59f376
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions drivers/vmwarevsphere/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 1 addition & 4 deletions drivers/vmwarevsphere/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions drivers/vmwarevsphere/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b59f376

Please sign in to comment.