Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Using HDiff feature always displays Info log output #303

Open
jrpell opened this issue Oct 3, 2024 · 1 comment
Open

[Bug]: Using HDiff feature always displays Info log output #303

jrpell opened this issue Oct 3, 2024 · 1 comment
Labels

Comments

@jrpell
Copy link

jrpell commented Oct 3, 2024

Contact Details

What happened?

When using the HDiff class, it should just create the assigned object and not display anything, but it always displays multiple INFO log messages. This shouldn't do this every single time a class is used in my opinion. I've tested in both 1.9.41 and 1.9.51 with the same results:

Here's what it shows:

>>> diff = HDiff(before_config=cfg_int.splitlines(), after_config=cfg_run.splitlines())
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`

CiscoConfParse Version

Version 1.9.41 and 1.9.51

What Operating System are you using?

Linux - Debian, Ubuntu, CentOS, RHEL or others

What Python version(s) have this problem?

Other (please specify)

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

I'm using Python 3.11.  Simply run the command below based on normal string configs from a running config versus an intended config:

cfg_run = """line con 0
 session-timeout 15 output
 exec-timeout 15 0
 logging synchronous
 no modem enable
 history size 50
 transport output telnet ssh
 stopbits 1"""

cfg_int = """line con 0
 session-timeout 15 output
 exec-timeout 15 0
 logging synchronous
 history size 50
 transport output telnet ssh
 stopbits 1"""

diff = HDiff(before_config=cfg_int.splitlines(), after_config=cfg_run.splitlines())

It should just create my object with no output, but instead it outputs several lines of INFO logging every single time. I do not want any logging output any time this class is used. It shouldn't output anything. Here's what it shows:

>>> diff = HDiff(before_config=cfg_int.splitlines(), after_config=cfg_run.splitlines())
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`

I've made sure debug is zero but that doesn't change anything. How can I force this logging to not show? Or if it's forced to show it all the time, then we should have the option to remove it.



### Python tracebacks

```shell
No tracebacks.

Relevant log output

>>> diff = HDiff(before_config=cfg_int.splitlines(), after_config=cfg_run.splitlines())
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.567 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`
2024-10-03 14:04:37.569 | INFO     | ciscoconfparse.ciscoconfparse:__init__:701 - As of version 1.9.17 and later, `ignore_blank_lines=True` is only honored when `factory=True`


### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/mpenning/ciscoconfparse/blob/main/CONTRIBUTING.md)
@jrpell jrpell added the bug label Oct 3, 2024
@mpenning
Copy link
Owner

Sadly ciscoconfparse is End of Life. Please see #305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants