Skip to content

Commit e017bce

Browse files
committed
Fix bug where source_interface and vrf are both provided
1 parent 0923ffa commit e017bce

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

napalm/nxos/nxos.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,12 @@ def ping(
371371
elif source_interface != "":
372372
command += " source-interface {}".format(source_interface)
373373

374-
if vrf != "":
375-
command += " vrf {}".format(vrf)
374+
# source_interface and vrf are mutually exclusive, but since they
375+
# provide the same behavior, no need to raise an exception--just
376+
# prefer source_interface.
377+
if not source_interface:
378+
if vrf != "":
379+
command += " vrf {}".format(vrf)
376380
output = self._send_command(command, raw_text=True)
377381
assert isinstance(output, str)
378382

0 commit comments

Comments
 (0)