pyangbind icon indicating copy to clipboard operation
pyangbind copied to clipboard

fix: serialisation element ordering for py<3.6

Open unsignedint opened this issue 7 years ago • 2 comments
trafficstars

Found an issue where serialised XML output would have incorrect ordering sometimes. It turns out I never saw this because I was developing with python 3.6, which features an ordered dict implementation.

I have made an update to explicitly use OrderedDict instead, so we have the same behaviour for python <3.6.

unsignedint avatar Jul 03 '18 23:07 unsignedint

To be honest, I think this patch probably obviates the need for the structural XML document equality test I was doing to prove serialised outputs were the same. It turns out, I think, ordering does matter[1] and we may as well be consistent about it.

[1] found issues with NETCONF requests getting denied because of unexpected element ordering

unsignedint avatar Jul 03 '18 23:07 unsignedint

Codecov Report

Merging #217 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #217   +/-   ##
=======================================
  Coverage   71.51%   71.51%           
=======================================
  Files           7        7           
  Lines        1741     1741           
  Branches      463      463           
=======================================
  Hits         1245     1245           
  Misses        370      370           
  Partials      126      126
Impacted Files Coverage Δ
pyangbind/lib/serialise.py 77.87% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ea73fb3...7039a3a. Read the comment docs.

codecov[bot] avatar Jul 03 '18 23:07 codecov[bot]

Hi,

Could you please rebase to a recent versions of pyangbind, and python >= 3.7 (lowest automatically-tested version) ?

Thanks.

JoseIgnacioTamayo avatar Oct 13 '23 07:10 JoseIgnacioTamayo

Closing old Issue. Pyangbind has moved to Python >= 3.7

JoseIgnacioTamayo avatar Dec 11 '23 19:12 JoseIgnacioTamayo