-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
The sort function in lib/puppet_x/libvirt/sort_elements.rb tries to have equal XML for the output of the virsh command and the XML generated by the templates so we can diff that to see if we need to update.
The sort_elements is a recursive function sorting all XML elements by it's name. For Arrays elements which share the same name, this fails since the name is equal for each element. In this case you need to adapt the order of the Array used to generate the XML (eg. networks with portgroups and several vlans in a portgroup is such a case). Mostly this happens if you manually use virsh to edit/update and afterward adapt your'e puppet manifest.
Reference:
#75 tried to fix this for portgroups but was reverted since this should not be fixed in the provider but in the sort_elements function.
Workaround:
Adapt the order of Array in your'e manifest to match the order from the virsh command (as seen in the diff).