mpenning/ciscoconfparse2

[Bug]: order does not matter for policy-map

Closed this issue · 2 comments

Contact Details

No response

What happened?

The diff does not show differences in ordering on policy-map directives

(python 3.11)

CiscoConfParse Version

0.3.3

What Operating System are you using?

Linux - Debian, Ubuntu, CentOS, RHEL or others

What Python version(s) have this problem?

Python 3.10

Show us how to reproduce the problem. Please tell us if the problem is specific to certain inputs or situations.

from ciscoconfparse2 import Diff

running = """
policy-map type inspect pm-self-to-accesspoints
  class type inspect cm-self-to-accesspoints
    inspect
  class type inspect self-to-any-dhcp
    pass
  class class-default
    drop
"""
generated = """
policy-map type inspect pm-self-to-accesspoints
  class type inspect self-to-any-dhcp
    pass
  class type inspect cm-self-to-accesspoints
    inspect
  class class-default
    drop
"""
diff = Diff(old_config=running, new_config=generated)
for line in diff.get_diff():
    print(line)

Python tracebacks

none

Relevant log output

no output / diff. however, the configs differ semantically.

see
https://community.cisco.com/t5/switching/evaluation-order-of-class-maps-under-policy-map/td-p/2834242
https://community.cisco.com/t5/routing/qos-policy-map-classes-order/td-p/1863137

Code of Conduct

Thank you for the bug report! Technically, this is a problem with hier_config version 2.2.3. I outsourced IOS diffs to hier_config, which overall is a better diff, but they do not handle multi-level diff ordering (such as your example) yet.

I will update this issue when they fix it, but honestly, it's could be a long-term wait unless I build my own hier_config PR for it. I filed this as hier_config issue # 117

According to hier_config developers, they will not support diffs between config order changes. As such, I will close this as a won't do.