Fix: Removed automatic import of handler object #506
Merged
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.
Description
fixes #505 .
fixed #502
Thanks for everyone for commenting about this critical one!
Right after the Arp and Dns spoofing hunters were moved to run as plugins #500 . A new feature for specifying thread count was merged #433 .
While both of those changes worked fine by themselves, together they introduced a new problem.
In order to control the thread count, a
get_config
had to be called in thehandler.py
module, right before instantiation.Now, when initializing the plugins, an import from the package
kube_hunter.core.events.types
had to be called.The problem arose when the package
..events
did an import by itself from thehandler.py
module, thus initializing the handler before config was set.After taking a deep look into this, I realised we don't need this automatic import, and were better off importing this manually by adding the
.handler
explicitly to each import.Another issue arose after that, which I'm sure I don't need to explain to those who are familiar with python, it's a bad habit to call an imported object with the same name as it's father module.
Solution
handler.py
was renamed toevent_handler.py
events
packageThis should fix everything. and the upstream version would follow as
0.6.8
Contribution checklist