Closed chrispella closed 3 years ago
Thanks for raising that issue, it was a bug in internal logic, fixed in latest commit b6694f840324897e64d70f24719cc7db511cd2fb, feel free to clone and install to test it.
In return, cleaned up your template a bit, as these things either not required or do nothing:
<group name="service">
service {{ ignore }}
<group name="epipe.{{ service_id }}" default="none">
epipe {{ service_id }} customer {{ customer_id }} create
description "{{ description | ORPHRASE }}"
service-mtu {{ service_mtu }}
service-name "{{ service_name | ORPHRASE }}"
<group name="endpoint" default="none">
endpoint {{ endpoint }} create
revert-time {{ revert_time }}
exit {{ _end_ }}
</group>
<group name="sap.{{ sap_id }}" default="none">
sap {{ sap_id | resub(r"\*", "qinq") | ORPHRASE }} create
description "{{ description | ORPHRASE }}"
multi-service-site "{{ mss_name }}"
<group name="ingress">
ingress {{ _start_ }}
qos {{ sap_ingress | default("1") }}
scheduler-policy {{ scheduler_policy | default("none")}}
exit {{ _end_ }}
</group>
<group name="egress">
egress {{ _start_ }}
scheduler-policy {{ scheduler_policy | default("none") }}
qos {{ sap_egress | default("1)") }}
exit {{ _end_ }}
</group>
no shutdown {{ state | set("enabled") | default("disabled") }}
exit {{ _end_ }}
</group>
<group name="pwr_sdp.{{pwr_spoke_sdp_id}}**" default="none">
spoke-sdp {{ pwr_spoke_sdp_id }}:{{vc_id }} endpoint {{ endpoint }} create
precedence {{ precedence | default("default_precedence") }}
no shutdown {{ state | set("enabled") | default("disabled") }}
exit {{ _end_ }}
</group>
<group name="regular_sdp.{{r_spoke_sdp_id}}**" default="none">
spoke-sdp {{ r_spoke_sdp_id }}:{{vc_id }} create
no shutdown {{ state | set("enabled") | default("disabled") }}
exit {{ _end_ }}
</group>
no shutdown {{ state | set("enabled") | default("disabled") }}
exit {{ _end_ }}
</group>
exit {{ _end_ }}
</group>
Thanks so much. It works fine on our end. As you noticed we are still learning what is required with the templates
Working now.
Oh, maybe I shouldn't close it until it is merged into master?
Fix already merged in master brunch and will be included in next release.
Thanks again for raising that problem, let me know if you'll have any further issues, will see what I can do.
We are trying to parse the configuration from a Nokia 7750 SR router. So far we have had good luck with ttp and are looking to use it to replace some messy and fragile collections of regexes. However we have run into a issue where we have a matched pattern that is being repeated in the next group and haven't been able to find out whether it is our template or a bug. For instance, if you look at the output the sdp with id 8035 from epipe id 103206 shows up in the next epipe group 103256. The formatting is off below unless you open it to edit ... Is there a way to preserve the spacing?
Here is our template:
Here is an extract of the config file which we are using:
What we see when we parse it is that the one