Skip to content

Commit

Permalink
B #169: copy only relevant sections
Browse files Browse the repository at this point in the history
  • Loading branch information
treywelsh committed Nov 10, 2021
1 parent 11524ba commit f2d42ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion opennebula/resource_opennebula_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,15 @@ func resourceOpennebulaVirtualMachineUpdate(d *schema.ResourceData, meta interfa
}

updateConf := false
tpl := &vmInfos.Template

// retrieve only template sections managed by updateconf method
tpl := vm.NewTemplate()
for _, name := range []string{"OS", "FEATURES", "INPUT", "GRAPHICS", "RAW", "CONTEXT"} {
vectors := vmInfos.Template.GetVectors(name)
for _, vec := range vectors {
tpl.Elements = append(tpl.Elements, vec)
}
}

if d.HasChange("os") {
updateConf = true
Expand Down

0 comments on commit f2d42ca

Please sign in to comment.