filtered_interface=['interface Gi1/0/23', 'interface Gi1/0/19', 'interface Gi3/0/5', 'interface Gi2/0/23', 'interface Gi2/0/13', 'interface Gi2/0/17']

filtered_tech=[' description TECH2_5857', ' description TECH2_5855', ' description TECH2_5847', ' description TECH2_6363', ' description TECH2_6575', ' description TECH2_5030']

I have the above list I want to import into a dynamic table. Every time getcab runs it provides unique info after the interface or description. This list can range from one item to 48 items. Ive been trying to get Jinja2 working but I was only able to display the last items in both list.

I cant seem to get jinja2 to display what i need, im not a developer by trade so please excuse the lack of understanding if its a simple fix.

What im getting is below varies, Ive tried so many things so its more or less mashing together right now. any help is massively appreciated.

Common thing is filtered_interface all ends up in the same row so example would be.

Local Interface   Device Name
                    |[' description ASTECH2_5857', 
                    |' description ASTECH2_5855', 
                    |' description ASTECH2_5847',
                    |' description ASTECH2_6363', 
                    |' description ASTECH2_6575']

return render_template('results.html', cab=cab, columns=filtered_interface, items=filtered_tech)

What I would like to see is something like the below

Local Interface   Device Name

Gi0/0/1         | Tech2_1234
Gi0/0/2         | Tech2_1237
Gi0/0/3         | Tech2_1236
Gi0/0/4         | Tech2_1235

0 Answers