From: Johannes Berg Date: Thu, 27 Nov 2014 17:42:54 +0000 (+0100) Subject: tests: Ignore status responses without = X-Git-Tag: hostap_2_4~1009 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bb9d861f970b4d818997351b8cab778ef19ca25;p=thirdparty%2Fhostap.git tests: Ignore status responses without = There are valid status (and possibly status-driver) responses that don't have a name=value format, ignore those in the test framework parser. Signed-off-by: Johannes Berg --- diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 8d0bb5b29..e4788ac36 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -308,7 +308,11 @@ class WpaSupplicant: lines = res.splitlines() vals = dict() for l in lines: - [name,value] = l.split('=', 1) + try: + [name,value] = l.split('=', 1) + except ValueError: + logger.info(self.ifname + ": Ignore unexpected status line: " + l) + continue vals[name] = value return vals @@ -323,7 +327,11 @@ class WpaSupplicant: lines = res.splitlines() vals = dict() for l in lines: - [name,value] = l.split('=', 1) + try: + [name,value] = l.split('=', 1) + except ValueError: + logger.info(self.ifname + ": Ignore unexpected status-driver line: " + l) + continue vals[name] = value return vals