Skip to content

Commit

Permalink
add errorhanling
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert Müller committed Aug 17, 2017
1 parent e03a78e commit 995d9e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vsphere/resource_vsphere_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
networkInterfaces := make([]map[string]interface{}, 0)

deviceList, err := vm.Device(context.TODO())
if err != nil {
return fmt.Errorf("failed to retrieve vm devices")
}
deviceList = deviceList.SelectByType((*types.VirtualEthernetCard)(nil))
log.Printf("[DEBUG] Device list %+v", deviceList)
for _, device := range deviceList {
Expand Down

0 comments on commit 995d9e8

Please sign in to comment.