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

matching irrelevant group #108

Open
pdimop opened this issue May 2, 2023 · 1 comment
Open

matching irrelevant group #108

pdimop opened this issue May 2, 2023 · 1 comment

Comments

@pdimop
Copy link

pdimop commented May 2, 2023

data_to_parse =

vlan 100
    interface "Eth1"
        description "management interface"
    exit
exit
vrf 200
    interface "Eth2"
        iplist
            address bbbb::::2/128
        exit
    exit
exit

ttp_template =

<group name="vlan.{{ vlan }}**">
vlan {{ vlan | _start_ }}
    <group name="{{ interface }}**">
    interface "{{ interface | _start_ }}" 
        description "{{ description | re(r".*") }}" 
        <group name="iplist**">
        iplist{{ _start_ }}
            <group>
            address {{ address | _start_ }}
            </group> ## end of addresses
        exit{{ _end_ }}
        </group> ## end of iplist
    exit{{ _end_ }}
    </group> ## end of interface
exit{{ _end_ }}
</group> ## end of vlan 

output=

[[{
    'vlan': {
        '100': {
            'Eth1': {
                'description': 'management interface',
                'iplist': {
                    'address': 'bbbb::::2/128'
                }
            }
        }
    }
}]]

Somehow it matches the IP of another interface.
BR

@pdimop
Copy link
Author

pdimop commented Jul 23, 2023

the issue is still there in 0.9.5

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

No branches or pull requests

1 participant