
I'm using Python v 3.10.11 and ttp v 0.9.5. I am trying to build a TTP template that can extract an unknown number of words from a line into a group.
The data could look like this:
The closest template that I can come up with is the following, but it misses the Member Port 6/12 in the first example, and returns the rest as a single string instead of a list of ports:
The data could look like this:
Output:link-aggregate 0 AdminState:Up OperState:IS
Member Ports: 6/1 6/5 6/6 6/7 6/8 6/9 6/10 6/11
6/12
Description: << The port description >>
or, the data could like like this:Output:link-aggregate 0 AdminState:Up OperState:IS
Member Ports: 6/1
Description: << The port description >>
or anything in between.The closest template that I can come up with is the following, but it misses the Member Port 6/12 in the first example, and returns the rest as a single string instead of a list of ports:
Output:link-aggregate {{ interfaceId }} AdminState:{{ AdminState }} OperState:{{ OperState }}
Member Ports: {{ MemberPorts | PHRASE }}
Description: {{ Description | ORPHRASE }}
How can I get my Member Ports into a list, and include any that may follow on the next line?