Skip to content

Commit

Permalink
Merge pull request #1067 from terraform-providers/b_skip_unexpected_n…
Browse files Browse the repository at this point in the history
…ic_entries

r/vm: Skip unexpected NIC entries
  • Loading branch information
bill-rich authored May 7, 2020
2 parents 0851414 + 771d723 commit 3a2bd7c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,11 @@ func NetworkInterfacePostCloneOperation(d *schema.ResourceData, c *govmomi.Clien
// Any other device past the end of the network devices listed in config needs to be removed.
if len(curSet) < len(srcSet) {
for i, si := range srcSet[len(curSet):] {
sm := si.(map[string]interface{})
sm, ok := si.(map[string]interface{})
if !ok {
log.Printf("[DEBUG] Extra entry in NIC source list, but not of expected type")
continue
}
r := NewNetworkInterfaceSubresource(c, d, sm, nil, i+len(curSet))
dspec, err := r.Delete(l)
if err != nil {
Expand Down

0 comments on commit 3a2bd7c

Please sign in to comment.