Skip to content

Sort issue, continuesly update of values because of wrong order #85

@trefzer

Description

@trefzer

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions