Skip to content

Conversation

@safrimus
Copy link

@safrimus safrimus commented Aug 5, 2015

If the wifi is not connected to any network, the wireless_watcher node crashes as it's not able to parse the 'Bit Rate' and other fields. I just added a try block for each field, although I'm not sure if this is the best way to do this..

@mikepurvis
Copy link
Contributor

If you're committed to the field-by-field approach, please us dict.get rather than all these try blocks swallowing errors.

But a better approach (IMO) would be to detect upfront when not connected at all and just never hit this code path. Then again, my recollection about all this is that the format of iwconfig output varies from between different wireless cards/drivers, so maybe it's better to just be robust upfront and not try to play whack-a-mole with it.

@safrimus
Copy link
Author

safrimus commented Aug 5, 2015

Added the check for wifi connection and to bypass the parsing if it's not connected. Also, I left the field-by-field checks in to account for the variations in the iwconfig output.

@mikepurvis
Copy link
Contributor

LGTM.

mikepurvis added a commit that referenced this pull request Aug 6, 2015
CORE-1738: wireless_watcher dies
@mikepurvis mikepurvis merged commit a201427 into master Aug 6, 2015
@safrimus safrimus deleted the CORE-1738 branch September 1, 2015 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants