From 29d902918d852506db6ca315e495f15bbba5ae12 Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 11 Aug 2016 14:33:41 -0700 Subject: [PATCH] Change tshark version check for compatibility The version string changed in tshark 2.0.2 in Ubuntu 16. Perhaps we should just check for the version string itself to be more robust but this is probably OK for now. --- mininet/test/test_walkthrough.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mininet/test/test_walkthrough.py b/mininet/test/test_walkthrough.py index cf7194d..628ceb8 100755 --- a/mininet/test/test_walkthrough.py +++ b/mininet/test/test_walkthrough.py @@ -16,8 +16,8 @@ from distutils.version import StrictVersion def tsharkVersion(): "Return tshark version" versionStr = quietRun( 'tshark -v' ) - versionMatch = re.findall( r'TShark \d+.\d+.\d+', versionStr )[0] - return versionMatch.split()[ 1 ] + versionMatch = re.findall( r'TShark[^\d]*(\d+.\d+.\d+)', versionStr ) + return versionMatch[ 0 ] # pylint doesn't understand pexpect.match, unfortunately! # pylint:disable=maybe-no-member