I was using sym-links.
For source-control, I have a git-repo. I had put sym-links pointing from the old checks
-directory back to the plugin-file in that repo. Starting through the above mentioned guide, I created a new sym-link from the new local/lib/check_mk/base/plugins/agent_based/
. Adding the required .py
suffix in the process. So now I have 2 sym-links pointing to one piece of code, which I had modified in-place.
Turns out: If you do not delete the plugin from the old location, you will always test the old plugin. With sym-links, you will test the new code in the old environment, giving you that error.
Notice the path in the error-message!
As for the __name__
error itself: It seems to come from doing relative imports import .something
. Notice the leading dot. It means "in the same directory as this file". Somehow the old environment was not able to cope with that.