egberts / bind9_parser

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

parsing logging #34

Closed rharolde closed 2 years ago

rharolde commented 2 years ago

Oddly, it seems to fail on this part: logging { channel "general_file" { file "/var/log/named/general.log" versions 10 size 104857600; severity dynamic; print-time yes; print-severity yes; print-category yes; }; category "general" { "general_file"; "notice-alert_file"; };

egberts commented 2 years ago

Two things happening there:

egberts commented 2 years ago

I've added your sample into tests/bug-reports/github-issue-34.named.conf.

Ran:

$ ./dump-named-conf.py tests/bug-reports/github-issue-34.named-variant1.conf 

And got a new output of:

{'logging': {'category_groups': [{'category_group_name': 'general',
                                  'channel_names': ['general_file',
                                                    'notice-alert_file']}],
             'channels': [{'channel_name': 'general_file',
                           'path_name': '/var/log/named/general.log',
                           'print_category': 'yes',
                           'print_severity': 'yes',
                           'print_time': 'yes',
                           'severity': ['dynamic'],
                           'size_spec': [104857600],
                           'versions': 10}]}}
egberts commented 2 years ago

Fixed in HEAD (4de2cfc75d52ad48d5520549c60c23757d714930)