1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-07 05:30:44 +00:00

target: Ensure returning False when is_network_connected fails

This commit is contained in:
Brendan Jackman 2017-10-24 16:03:10 +01:00
parent 486b3f524e
commit 417ab3df3e

View File

@ -715,7 +715,8 @@ class Target(object):
# We'll use our own retrying mechanism (rather than just using ping's -c
# to send multiple packets) so that we don't slow things down in the
# 'good' case where the first packet gets echoed really quickly.
for _ in range(5):
attempts = 5
for _ in range(attempts):
try:
self.execute(command)
return True
@ -737,6 +738,10 @@ class Target(object):
# error.
raise
self.logger.debug('Failed to ping {} after {} attempts'.format(
GOOGLE_DNS_SERVER_ADDRESS, attempts))
return False
class LinuxTarget(Target):
path = posixpath