Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 """Connect to a WiFi service and report the amount of time it took | 3 """Connect to a WiFi service and report the amount of time it took |
| 4 | 4 |
| 5 This script initiates a connection to a WiFi service and reports | 5 This script initiates a connection to a WiFi service and reports |
| 6 the time to major state changes (assoc, config). If the connection | 6 the time to major state changes (assoc, config). If the connection |
| 7 fails within the desired time, it outputs the contents of the log | 7 fails within the desired time, it outputs the contents of the log |
| 8 files during that intervening time. | 8 files during that intervening time. |
| 9 | 9 |
| 10 """ | 10 """ |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 'SSID': ssid, | 154 'SSID': ssid, |
| 155 'Security': security | 155 'Security': security |
| 156 } | 156 } |
| 157 | 157 |
| 158 if security == '802_1x': | 158 if security == '802_1x': |
| 159 cert_args = psk.split(':') | 159 cert_args = psk.split(':') |
| 160 (connection_settings['Identity'], | 160 (connection_settings['Identity'], |
| 161 connection_settings['CertPath']) = cert_args[:2] | 161 connection_settings['CertPath']) = cert_args[:2] |
| 162 if len(cert_args) > 2: | 162 if len(cert_args) > 2: |
| 163 connection_settings['AuthorityPath'] = cert_args[2] | 163 connection_settings['AuthorityPath'] = cert_args[2] |
| 164 if len(cert_args) > 3: | |
| 165 connection_settings['Passphrase'] = cert_args[3] | |
|
Paul Stewart
2011/01/05 22:28:29
Instead of continuing to tack on optional paramete
| |
| 164 else: | 166 else: |
| 165 connection_settings['Passphrase'] = psk | 167 connection_settings['Passphrase'] = psk |
| 166 | 168 |
| 167 global logs | 169 global logs |
| 168 global handler | 170 global handler |
| 169 logs = OpenLogs('/var/log/messages') | 171 logs = OpenLogs('/var/log/messages') |
| 170 | 172 |
| 171 assoc_start = time.time() | 173 assoc_start = time.time() |
| 172 handler = ConnectStateHandler(bus, connection_settings, options.hidden, | 174 handler = ConnectStateHandler(bus, connection_settings, options.hidden, |
| 173 assoc_timeout, assoc_start, options.debug) | 175 assoc_timeout, assoc_start, options.debug) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 210 |
| 209 print ('OK %3.1f %3.1f %s (assoc and config times in sec, quirks)' % | 211 print ('OK %3.1f %3.1f %s (assoc and config times in sec, quirks)' % |
| 210 (assoc_time, config_time, str(connect_quirks.keys()))) | 212 (assoc_time, config_time, str(connect_quirks.keys()))) |
| 211 | 213 |
| 212 if connect_quirks: | 214 if connect_quirks: |
| 213 DumpLogs(logs) | 215 DumpLogs(logs) |
| 214 sys.exit(0) | 216 sys.exit(0) |
| 215 | 217 |
| 216 if __name__ == '__main__': | 218 if __name__ == '__main__': |
| 217 main(sys.argv) | 219 main(sys.argv) |
| OLD | NEW |