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
Hello! Thanks for this awesome tool. I had been using it with customers for the last 6 months (when I discovered it), and really saved me a lot of work.
ciscoconfparse2.Diff does not work as expected when it finds commas in lines such as descriptions or the banner.
In the following examples I am using ciscoconfparse2.Diff to compare a configuration file (a backup of the running-config of a router) and a running-configuration (taken using SSH of the same router).
For example:
Having the following banner in a configuration template:
banner login ^C
******************************** NOTICE ********************************
This is a private computer system.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and
disclosed to authorized site, information security, and law enforcement
personnel, as well as authorized officials of other agencies, both
domestic and foreign. By using this system, the user consents to such
interception, monitoring, recording, copying, auditing, inspection, and
disclosure at the discretion of authorized site or personnel.
Unauthorized or improper use of this system may result in civil and
criminal penalties. By continuing to access this system you indicate
your awareness of and consent to these terms and conditions of use.
DISCONNECT IMMEDIATELY if you do not agree to the conditions stated in
this warning.
***********************************************************************
^C
and having the exact same banner in the running configuration of a Cisco IOS XDR router.
C8500-12X#sh run | begin banner
banner login ^CC
******************************** NOTICE ********************************
This is a private computer system.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and
disclosed to authorized site, information security, and law enforcement
personnel, as well as authorized officials of other agencies, both
domestic and foreign. By using this system, the user consents to such
interception, monitoring, recording, copying, auditing, inspection, and
disclosure at the discretion of authorized site or personnel.
Unauthorized or improper use of this system may result in civil and
criminal penalties. By continuing to access this system you indicate
your awareness of and consent to these terms and conditions of use.
DISCONNECT IMMEDIATELY if you do not agree to the conditions stated in
this warning.
***********************************************************************
^C
When I run ciscoconfparse2.Diff, the output will look like the following (I am running ciscoconfparse2.Diff through Ansible, that's the reason the output result.differences is in YAML)
result.differences:
- |-
no banner login ^CC
******************************** NOTICE ********************************
This is a private computer system.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and
disclosed to authorized site, information security, and law enforcement
personnel, as well as authorized officials of other agencies, both
domestic and foreign. By using this system, the user consents to such
interception, monitoring, recording, copying, auditing, inspection, and
disclosure at the discretion of authorized site or personnel.
Unauthorized or improper use of this system may result in civil and
criminal penalties. By continuing to access this system you indicate
your awareness of and consent to these terms and conditions of use.
DISCONNECT IMMEDIATELY if you do not agree to the conditions stated in
this warning.
***********************************************************************
^C
- |-
banner login ^C
******************************** NOTICE ********************************
This is a private computer system.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted
monitored
recorded
copied
audited
inspected
and
disclosed to authorized site
information security
and law enforcement
personnel
as well as authorized officials of other agencies
both
domestic and foreign. By using this system
the user consents to such
interception
monitoring
recording
copying
auditing
inspection
and
disclosure at the discretion of authorized site or personnel.
Unauthorized or improper use of this system may result in civil and
criminal penalties. By continuing to access this system you indicate
your awareness of and consent to these terms and conditions of use.
DISCONNECT IMMEDIATELY if you do not agree to the conditions stated in
this warning.
***********************************************************************
^C
When I take the commas out of the banner in both, the configuration template and the running config, the result is quite neat and as expected, no differences are shown:
result.differences: []
An extra example can be provided using class maps.
If I add the following class map to my configuration template and to my running-config, I expect to find no differences, nevertheless, something happens with the commas and the output is not the one expected:
temonumentum
changed the title
[Bug]: A comma in running_config breaks the ciscoconfparse.Diff
[Bug]: A comma in running_config breaks the ciscoconfparse2.Diff
Jan 17, 2025
temonumentum
changed the title
[Bug]: A comma in running_config breaks the ciscoconfparse2.Diff
[Bug]: A comma in running_config breaks the ciscoconfparse2.DiffJan 17, 2025
temonumentum
changed the title
[Bug]: A comma in running_config breaks the ciscoconfparse2.Diff
[Bug]: A comma in running_config breaks the ciscoconfparse2.Diff output
Jan 17, 2025
I do not know what you're doing with ansible. Please remove ansible from the problem and reproduce with strictly ciscoconfparse2, such as a script like this (which BTW does not seem to have a problem)...
Contact Details
[email protected]
What happened?
Hello! Thanks for this awesome tool. I had been using it with customers for the last 6 months (when I discovered it), and really saved me a lot of work.
ciscoconfparse2.Diff
does not work as expected when it finds commas in lines such as descriptions or the banner.In the following examples I am using
ciscoconfparse2.Diff
to compare a configuration file (a backup of the running-config of a router) and a running-configuration (taken using SSH of the same router).For example:
Having the following banner in a configuration template:
and having the exact same banner in the running configuration of a Cisco IOS XDR router.
When I run
ciscoconfparse2.Diff
, the output will look like the following (I am runningciscoconfparse2.Diff
through Ansible, that's the reason the outputresult.differences
is in YAML)When I take the commas out of the banner in both, the configuration template and the running config, the result is quite neat and as expected, no differences are shown:
An extra example can be provided using class maps.
If I add the following class map to my configuration template and to my running-config, I expect to find no differences, nevertheless, something happens with the commas and the output is not the one expected:
Class map added:
ciscoconfparse2.Diff
output:CiscoConfParse Version
ciscoconfparse2 == 0.7.73
What Operating System are you using?
Linux - Debian, Ubuntu, CentOS, RHEL or others
What Python version(s) have this problem?
Python 3.11
Show us how to reproduce the problem. Please tell us if the problem is specific to certain inputs or situations.
Python tracebacks
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: