You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
…or portgroups inside XML"
This partly reverts commit 4c55908 (#75).
The part 'human readable diff' is kept, the part 'correct sort...' is reverted.
Fixing the sort in the provider only is the wrong approach. This module uses
the function defined in lib/puppet_x/libvirt/sort_elements.rb to
have equal XML's to compare. The sort_elements function is used in the provider
to ensure sorting of the 'is' part. The 'should' part is sorted using
the function libirt::normalxml on the template XML output.
See Bug #85
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).
The text was updated successfully, but these errors were encountered: