File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,19 +191,22 @@ def wait_for_connected(interface, essid):
191191 print_cmd (cmd )
192192 output = sp .check_output (shlex .split (cmd ), universal_newlines = True )
193193 print (output )
194- state , ssid = output .strip ().splitlines ()
194+ # if state is not connected, no ssid will be provided
195+ state , * ssid = output .strip ().splitlines ()
196+ ssid = next (iter (ssid ), None )
195197
196198 if state .startswith ("100" ) and ssid == essid :
197199 print ("Reached connected state with ESSID: {}" .format (essid ))
200+ elif not state .startswith ("100" ):
201+ error_msg = "State is not connected: {}" .format (state )
202+ raise SystemExit (error_msg )
198203 elif ssid != essid :
199204 error_msg = (
200205 "ERROR: did not reach connected state with ESSID: {}\n "
201206 "ESSID mismatch:\n Excepted:{}\n Actually:{}"
202207 ).format (essid , ssid , essid )
203208 raise SystemExit (error_msg )
204- elif not state .startswith ("100" ):
205- error_msg = "State is not connected: {}" .format (state )
206- raise SystemExit (error_msg )
209+
207210 print ()
208211
209212
You can’t perform that action at this time.
0 commit comments