Closed desecnd closed 10 months ago
Hey! Nice work and thanks for the PR. On initial run I can verify it is running on my laptop without any issues.
If you can submit a commit to fix the linting, I think we can merge this PR.
Sure! I missed the .flake8
file, my mistake, will fix it right away : )
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 usingiw <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)user gets information about the process of trying different commands
This is backward-compatible solution so I believe it won't "spoil" implementation in older version of
iw
.