- cnt = 'count {}'.format(count) \
- if count else ''
-
- vrf = 'vrf {}'.format(vrf) if vrf else ''
-
- lookup_vrf = 'lookup-in-vrf {}'.format(lookup_vrf) if lookup_vrf else ''
+ gateway = kwargs.get("gateway", '')
+ intf = kwargs.get("interface", '')
+ use_sw_index = kwargs.get("use_sw_index", True)
+ resolve_attempts = kwargs.get("resolve_attempts", 10)
+ count = kwargs.get("count", 1)
+ vrf = kwargs.get("vrf", None)
+ l_vrf = kwargs.get("lookup_vrf", None)
+ multipath = kwargs.get("multipath", False)
+ weight = kwargs.get("weight", None)
+ local = kwargs.get("local", False)
+
+ if intf:
+ if use_sw_index:
+ int_cmd = ('sw_if_index {}'.
+ format(Topology.get_interface_sw_index(node, intf)))
+ else:
+ int_cmd = intf
+ else:
+ int_cmd = ''