Merge pull request #685 from maufl/fix-ping-parse-regex
Fix regex for ping result parsing, supporting optional 'packets' word in ping output
This commit is contained in:
+1
-1
@@ -633,7 +633,7 @@ class Mininet( object ):
|
|||||||
# Check for downed link
|
# Check for downed link
|
||||||
if 'connect: Network is unreachable' in pingOutput:
|
if 'connect: Network is unreachable' in pingOutput:
|
||||||
return 1, 0
|
return 1, 0
|
||||||
r = r'(\d+) packets transmitted, (\d+) received'
|
r = r'(\d+) packets transmitted, (\d+)( packets)? received'
|
||||||
m = re.search( r, pingOutput )
|
m = re.search( r, pingOutput )
|
||||||
if m is None:
|
if m is None:
|
||||||
error( '*** Error: could not parse ping output: %s\n' %
|
error( '*** Error: could not parse ping output: %s\n' %
|
||||||
|
|||||||
Reference in New Issue
Block a user