mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	Merge pull request #196 from bjackman/is-network-connected
target: Ensure returning False when is_network_connected fails
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user