--unique-attributes does not seem to work
BegBlev opened this issue · comments
Hello,
I'm trying to compare iDRAC XML configuration files. Nodes are identified by "FQDD" attribute.
Some nodes are not identified as beeing the same.
xmldiff
version is 2.4
runnning on Ubuntu 20.04
For instance:
file1.xml contains:
...
<Component FQDD="NIC.Integrated.1-1-1">
<Attribute Name="BlnkLeds">0</Attribute>
<!-- <Attribute Name="VirtMacAddr">00:00:00:00:00:00</Attribute> -->
<Attribute Name="VirtualizationMode">NONE</Attribute>
<!-- <Attribute Name="NParEP">Disabled</Attribute> -->
<Attribute Name="LegacyBootProto">PXE</Attribute>
<Attribute Name="WakeOnLan">Disabled</Attribute>
<!-- <Attribute Name="VLanId">0</Attribute> -->
<!-- <Attribute Name="NumberVFAdvertised">32</Attribute> -->
<Attribute Name="TcpIpViaDHCP">Disabled</Attribute>
<!-- <Attribute Name="IscsiViaDHCP">Disabled</Attribute> -->
<Attribute Name="ChapAuthEnable">Disabled</Attribute>
<!-- <Attribute Name="ChapMutualAuth">Disabled</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorIpAddr">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorSubnet">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorGateway">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorName"></Attribute> -->
<!-- <Attribute Name="IscsiInitiatorChapId"></Attribute> -->
<!-- <Attribute Name="IscsiInitiatorChapPwd"></Attribute> -->
<!-- <Attribute Name="FirstTgtIpAddress">0.0.0.0</Attribute> -->
<!-- <Attribute Name="FirstTgtTcpPort">3260</Attribute> -->
<!-- <Attribute Name="FirstTgtBootLun">0</Attribute> -->
<!-- <Attribute Name="FirstTgtIscsiName"></Attribute> -->
<!-- <Attribute Name="FirstTgtChapPwd"></Attribute> -->
<!-- <Attribute Name="VFDistribution">32:0:0:0</Attribute> -->
</Component>
...
and file2.xml contains:
<Component FQDD="NIC.Integrated.1-1-1">
<Attribute Name="BlnkLeds">0</Attribute>
<!-- <Attribute Name="VirtMacAddr">00:00:00:00:00:00</Attribute> -->
<Attribute Name="VirtualizationMode">NONE</Attribute>
<!-- <Attribute Name="NParEP">Disabled</Attribute> -->
<Attribute Name="LegacyBootProto">PXE</Attribute>
<Attribute Name="WakeOnLan">Disabled</Attribute>
<!-- <Attribute Name="VLanId">0</Attribute> -->
<!-- <Attribute Name="NumberVFAdvertised">32</Attribute> -->
<Attribute Name="TcpIpViaDHCP">Disabled</Attribute>
<!-- <Attribute Name="IscsiViaDHCP">Disabled</Attribute> -->
<Attribute Name="ChapAuthEnable">Disabled</Attribute>
<!-- <Attribute Name="ChapMutualAuth">Disabled</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorIpAddr">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorSubnet">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorGateway">0.0.0.0</Attribute> -->
<!-- <Attribute Name="IscsiInitiatorName"></Attribute> -->
<!-- <Attribute Name="IscsiInitiatorChapId"></Attribute> -->
<!-- <Attribute Name="IscsiInitiatorChapPwd"></Attribute> -->
<!-- <Attribute Name="FirstTgtIpAddress">0.0.0.0</Attribute> -->
<!-- <Attribute Name="FirstTgtTcpPort">3260</Attribute> -->
<!-- <Attribute Name="FirstTgtBootLun">0</Attribute> -->
<!-- <Attribute Name="FirstTgtIscsiName"></Attribute> -->
<!-- <Attribute Name="FirstTgtChapPwd"></Attribute> -->
<!-- <Attribute Name="VFDistribution">32:0:0:0</Attribute> -->
</Component>
From what I understand, both nodes should be considered as being the same using --unique-attributes Component@FQDD
option.
My command is:
xmldiff -f xml -p --ratio-mode accurate --unique-attributes "Component@FQDD" file1.xml file2.xml
The result is the following:
[...]
<Component FQDD="NIC.Integrated.1-1-1" diff:delete="">
<Attribute Name="BlnkLeds">0</Attribute>
<Attribute Name="VirtualizationMode">NONE</Attribute>
<Attribute Name="LegacyBootProto">PXE</Attribute>
<Attribute Name="WakeOnLan">Disabled</Attribute>
<Attribute Name="TcpIpViaDHCP">Disabled</Attribute>
<Attribute Name="ChapAuthEnable">Disabled</Attribute>
</Component>
[...]
<Component FQDD="NIC.Integrated.1-1-1" diff:insert="">
<Attribute Name="BlnkLeds" diff:delete="">0</Attribute>
<Attribute Name="VirtualizationMode" diff:delete="">NONE</Attribute>
<Attribute Name="BlnkLeds" diff:insert="">0</Attribute>
<Attribute Name="VirtualizationMode" diff:insert="">NONE</Attribute>
<Attribute Name="LegacyBootProto">PXE</Attribute>
<Attribute Name="WakeOnLan" diff:delete="">Disabled</Attribute>
<Attribute Name="TcpIpViaDHCP" diff:delete="">Disabled</Attribute>
<Attribute Name="ChapAuthEnable" diff:delete="">Disabled</Attribute>
<Attribute Name="WakeOnLan" diff:insert="">Disabled</Attribute>
<Attribute Name="TcpIpViaDHCP" diff:insert="">Disabled</Attribute>
<Attribute Name="ChapAuthEnable" diff:insert="">Disabled</Attribute>
</Component>
[...]
xmldiff
does not see this is the same node but thinks the node is removed and then added.
An other strange thing is that some child nodes are considered deleted and then inserted (ex: <Attribute Name="BlnkLeds" diff:delete="">
) despite the parent node is new...
Any idea?
Best regards
Vince
If those nodes are in different places in the file they will still be moved.