- vat.vat_terminal_exec_cmd_from_template('add_route.vat',
- network=network,
- prefix_length=prefix_len,
- via=via,
- vrf=vrf,
- interface=int_cmd,
- resolve_attempts=rap,
- count=cnt)
+ vat.vat_terminal_exec_cmd_from_template(
+ 'add_route.vat',
+ network=network,
+ prefix_length=prefix_len,
+ via='via {}'.format(gateway) if gateway else '',
+ vrf='vrf {}'.format(vrf) if vrf else '',
+ interface=int_cmd,
+ resolve_attempts='resolve-attempts {}'.
+ format(resolve_attempts) if resolve_attempts else '',
+ count='count {}'.format(count) if count else '',
+ lookup_vrf='lookup-in-vrf {}'.format(l_vrf) if l_vrf else '',
+ multipath='multipath' if multipath else '',
+ weight='weight {}'.format(weight) if weight else '',
+ local='local' if local else '')