Handle ping output for paused hosts
This commit is contained in:
+4
-1
@@ -383,12 +383,15 @@ class Mininet( object ):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _parsePing( pingOutput ):
|
def _parsePing( pingOutput ):
|
||||||
"Parse ping output and return packets sent, received."
|
"Parse ping output and return packets sent, received."
|
||||||
|
# Check for downed link
|
||||||
|
if 'connect: Network is unreachable' in pingOutput:
|
||||||
|
return (1, 0)
|
||||||
r = r'(\d+) packets transmitted, (\d+) received'
|
r = r'(\d+) packets transmitted, (\d+) received'
|
||||||
m = re.search( r, pingOutput )
|
m = re.search( r, pingOutput )
|
||||||
if m == None:
|
if m == None:
|
||||||
error( '*** Error: could not parse ping output: %s\n' %
|
error( '*** Error: could not parse ping output: %s\n' %
|
||||||
pingOutput )
|
pingOutput )
|
||||||
exit( 1 )
|
return (1, 0)
|
||||||
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
|
sent, received = int( m.group( 1 ) ), int( m.group( 2 ) )
|
||||||
return sent, received
|
return sent, received
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user