egberts / bind9_parser

Bind9 Parser in Python that can process all of ISC Bind configuration files
MIT License
22 stars 7 forks source link

ParseException for filter-aaaa-on-v4 #47

Closed stephan2012 closed 1 year ago

stephan2012 commented 2 years ago

Just faced pyparsing.exceptions.ParseException for option filter-aaaa-on-v4:

pyparsing.exceptions.ParseException: Expected '}', found 'filter'  (at char 2902), (line:98, col:9)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "library/bind9_info.py", line 227, in <module>
    main()
  File "library/bind9_info.py", line 223, in main
    run_module()
  File "library/bind9_info.py", line 208, in run_module
    result = my_clauses.parseString(toplevel_config, parseAll=True)
  File "/usr/local/lib/python3.8/ansible-2.12/lib/python3.8/site-packages/pyparsing/core.py", line 1141, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseSyntaxException: Expected '}', found 'filter'  (at char 2902), (line:98, col:9)

Config:

options {
  […]
  filter-aaaa-on-v4 yes;
  […]
};
egberts commented 2 years ago

Mmmmm, line 2518 of https://github.com/egberts/bind9_parser/blob/master/examples/rough-draft/namedconfglobal.py

Shows that this option is no longer used after 9.14.1. (It started in 9.8).

Perhaps setting the version number before reading the file to a desire version or your named.conf is actually holding some obsoleted clause/keywords?

This is a question.

stephan2012 commented 1 year ago

Perhaps setting the version number before reading the file to a desire version or your named.conf is actually holding some obsoleted clause/keywords?

The option is good since Ubuntu Server 18.04 LTS still brings BIND9 v9.11.3. Setting the target version is a good point. However, I was not yet able to figure out how to configure it. Did I miss any documentation about it?

egberts commented 1 year ago

Yeah. Because there isn't any support for versioning (yet) outside of examples/rough-draft/namedconfglobal.py

My bad.

It's a bug then. I got this.

stephan2012 commented 1 year ago

Thank you, @egberts! :-)