Skip to content

Commit

Permalink
can not -> cannot
Browse files Browse the repository at this point in the history
  • Loading branch information
bFekete authored and nywilken committed Nov 6, 2023
1 parent b7f62cf commit b34b0ec
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions builder/vsphere/driver/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,12 +837,12 @@ func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error

l, err := vm.driver.FindContentLibraryByName(ovf.Target.LibraryID)
if err != nil {
log.Printf("can not find content library due to %v", err)
log.Printf("cannot find content library: %v", err)
vm.logout()
return err
}
if l.library.Type != "LOCAL" {
return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+
return fmt.Errorf("cannot deploy a VM to the content library %s of type %s; "+
"the content library must be of type LOCAL", ovf.Target.LibraryID, l.library.Type)
}

Expand All @@ -853,7 +853,7 @@ func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error
if ovf.Spec.Description != item.Description {
err = vm.driver.UpdateContentLibraryItem(item, ovf.Spec.Name, ovf.Spec.Description)
if err != nil {
log.Printf("can not update content library due to %v", err)
log.Printf("cannot update content library: %v", err)
vm.logout()
return err
}
Expand Down Expand Up @@ -881,12 +881,12 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template

l, err := vm.driver.FindContentLibraryByName(template.Library)
if err != nil {
log.Printf("can not find content library due to %v", err)
log.Printf("cannot find content library: %v", err)
vm.logout()
return err
}
if l.library.Type != "LOCAL" {
return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+
return fmt.Errorf("cannot deploy a VM to the content library %s of type %s; "+
"the content library must be of type LOCAL", template.Library, l.library.Type)
}

Expand All @@ -896,7 +896,7 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template
if template.Placement.ResourcePool != "" {
rp, err := vm.driver.FindResourcePool(template.Placement.Cluster, template.Placement.Host, template.Placement.ResourcePool)
if err != nil {
log.Printf("can not find resource pool due to %v", err)
log.Printf("cannot find resource pool: %v", err)
vm.logout()
return err
}
Expand All @@ -905,7 +905,7 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template
if template.VMHomeStorage != nil {
d, err := vm.driver.FindDatastore(template.VMHomeStorage.Datastore, template.Placement.Host)
if err != nil {
log.Printf("can not find datastore due to %v", err)
log.Printf("cannot find datastore: %v", err)
vm.logout()
return err
}
Expand All @@ -922,7 +922,7 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template
if template.Placement.Folder != "" {
f, err := vm.driver.FindFolder(template.Placement.Folder)
if err != nil {
log.Printf("can not find folder due to %v", err)
log.Printf("cannot find folder: %v", err)
vm.logout()
return err
}
Expand All @@ -931,7 +931,7 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template
if template.Placement.Host != "" {
h, err := vm.driver.FindHost(template.Placement.Host)
if err != nil {
log.Printf("can not find host due to %v", err)
log.Printf("cannot find host: %v", err)
vm.logout()
return err
}
Expand All @@ -941,7 +941,7 @@ func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template
vcm := vcenter.NewManager(vm.driver.restClient.client)
_, err = vcm.CreateTemplate(vm.driver.ctx, template)
if err != nil {
log.Printf("can not create template due to %v", err)
log.Printf("cannot create template: %v", err)
vm.logout()
return err
}
Expand Down Expand Up @@ -1236,7 +1236,7 @@ func (vm *VirtualMachineDriver) FindContentLibraryTemplateDatastoreName(library

l, err := vm.driver.FindContentLibraryByName(library)
if err != nil {
log.Printf("can not find content library due to %v", err)
log.Printf("cannot find content library: %v", err)
vm.logout()
return nil, err
}
Expand All @@ -1257,7 +1257,7 @@ func (vm *VirtualMachineDriver) logout() {
return
}
if err := vm.driver.restClient.Logout(vm.driver.ctx); err != nil {
log.Printf("can not logout due to %s ", err.Error())
log.Printf("cannot logout: %s ", err.Error())
}
}

Expand Down

0 comments on commit b34b0ec

Please sign in to comment.