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
defdiff_files(backup_file, intended_file):
"""Utility function to provide `Unix Diff` between two files."""withopen(backup_file, encoding="utf-8") asfile:
backup=file.readlines()
withopen(intended_file, encoding="utf-8") asfile:
intended=file.readlines()
We've ran into a case where a legit, non UTF-8 encoded character is in the device running config output and causes a UnicodeDecodeError.
In this specific situation, the value is being caused by an SFP module that has a non-standard S/N value, yet it is the assigned valid value read from the module. The enforcement of UTF-8 is causing this to fail while being read into the function.
Since these characters are permitted into the operating system, there may be other cases for other values where they are present and also legit (but I can't think of any).
The text was updated successfully, but these errors were encountered:
Environment
Proposed Functionality
Allow non UTF-8 characters to be read into the configuration when comparing the backup and intended values.
Use Case
Currently the diff function is setting encoding to utf-8
nautobot-golden-config/nornir_plays/config_compliance.py
We've ran into a case where a legit, non UTF-8 encoded character is in the device running config output and causes a UnicodeDecodeError.
In this specific situation, the value is being caused by an SFP module that has a non-standard S/N value, yet it is the assigned valid value read from the module. The enforcement of UTF-8 is causing this to fail while being read into the function.
Since these characters are permitted into the operating system, there may be other cases for other values where they are present and also legit (but I can't think of any).
The text was updated successfully, but these errors were encountered: