Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to solve the problem described in #6
Problem
Following is example of executing
whm bootstrap
which currently results inwifi_heat_mapper.misc.ParseError
. (Ignore thelaunch.py
- the only thing it does is callingwifi_heat_mapper.main:driver()
)As described in the logs, there is a problem with parsing
ssid:
, fromiw <wif> info
command. The exact line where the problem lies ismisc.py:183
:This expression raises
IndexError
which is catched at the end of the function.Cause
The problem is probably related to update of the generated output by
iw
tool. Current version installed on my OS is5.9
(iw --version
).Example output:
As we can see there is no
ssid
field.Currently info about SSID can be obtained using
iw <wif> link
cmd.Example:
Solution
The simplest solution is to use
iw <wif> link
output to obtain the SSID. In this PR this is implemented by first checkingiw <wif> info
output and by catchingIndexError
. If exception is raised we can use the same functionget_application_output()
to get output fromiw <wif> link
. Information about trying to runiw <wif> link
is logged to the user. This approach has following benefits:iw <wif> info
is still the default approachiw <wif> link
is not launched until needed (info
failed)This is backward-compatible solution so I believe it won't "spoil" implementation in older version of
iw
.