Skip to content

Commit e272a6c

Browse files
authored
Don't ping link local broadcast (#188)
And don't fail the job immediately if the ping failed, the ARP entry may still exist anyway
1 parent d33e5a8 commit e272a6c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • environment/aws/topology_setup/test_server_platforms

environment/aws/topology_setup/test_server_platforms/ios_bridge.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,20 @@ def __broadcast_ping_request(self) -> None:
360360
continue
361361

362362
ip = addr[netifaces.AF_INET][0]["broadcast"]
363+
if ip.startswith("169.254"):
364+
continue
365+
363366
click.echo(f"Broadcasting ping request on {interface} ({ip})")
364-
subprocess.run(
365-
["ping", ip, "-c", "3"], check=True, capture_output=True, text=True
367+
result = subprocess.run(
368+
["ping", ip, "-c", "3"], check=False, capture_output=True, text=True
366369
)
367370

371+
if result.returncode != 0:
372+
click.secho(
373+
f"Failed to ping {ip} on {interface}: {result.stderr}",
374+
fg="yellow",
375+
)
376+
368377
def get_ip(self, location: str) -> str:
369378
"""
370379
Retrieve the IP address of the specified device.

0 commit comments

Comments
 (0)