-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mitogen does not deploy class level imports #682
Comments
Anything else I can provide to help debug this? Really missing being able to use mitogen for this. |
Can you try latest |
Thanks, but I still get the same error with that. Not using collections directly - I have the module installed directly in my library/module_utils directories. |
Ahh ok. I'll try and repro at some point soon; not sure how many other collaborators are currently working on mitogen 😬 lately it's just been me afaict. |
This is still a big thorn in my side. I'd be happy to try to help, but I really have no idea where to start looking. |
Ah my bad, somehow this ticket slipped my mind 😞 if you wanna debug it yourself you could put in an |
If you'd like me to debug it instead could you dump the task snippet from here? |
Thanks, I'll try to poke around. Really any pfsense_ task should trigger it. Something simple would be:
|
Well, renaming __impl to impl doesn't make a difference. Perhaps it is because we are doing imports at the class level and not top?
|
That seems to be it - if I duplicate the imports at the top-level then it runs fine. |
Oh that makes sense. Check out the various |
Actually I think the code in question is module_finder.scan() - https://github.com/dw/mitogen/blob/master/ansible_mitogen/module_finder.py#L128 which appears to only scan the top level modules for imports. I suspect it would be a fairly significant change to also scan any defined classes inside those modules. |
ooh good point 👍 |
So, I'm no python opcode expert, but it seems like we could find the code objects for classes in scan_code_imports() and do some kind of recursive scan:
|
Please drag-drop large logs as text file attachments.
Feel free to write an issue in your preferred format, however if in doubt, use
the following checklist as a guide for what to include.
Which version of Ansible are you running?
2.9.2
Is your version of Ansible patched in any way?
no
Are you running with any custom modules, or
module_utils
loaded?https://github.com/opoplawski/ansible-pfsense
Have you tried the latest master version from Git?
Yes
Do you have some idea of what the underlying problem may be?
I think mitogen is not deploying the local module_utils/network/pfsense/__impl tree
Mention your host and target OS and versions
CentOS 7 -> pfSense
Mention your host and target Python versions
host: python 2.7.5, target: python 2.7.16
The playbook works fine without mitogen.
Logs:
The text was updated successfully, but these errors were encountered: