-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
[v2] RuntimeWarning: Parent module 'ansible.plugins.action' not found while handling absolute import #12979
Comments
Steps to reproduce:
Expected behavior:
Actual behavior:
|
That is really weird, we disabled this warning message to remove this, as really it's just complaining about not finding an |
@mgedmin also not seeing this one as a problem any further. Running your example as checked out from git: # ansible-playbook -vv test.yml PLAY [localhost] ************************************************************** TASK: [example ] ************************************************************** REMOTE_MODULE example ok: [localhost] => {"changed": false, "msg": "Hello"} PLAY RECAP ******************************************************************** localhost : ok=1 changed=0 unreachable=0 failed=0 Are you still seeing this? If not, we'll go ahead and close it, especially as we haven't heard any further reports of this occuring. |
Yeah, I'm still seeing RuntimeWarnings:
|
I've tried the test in a very clean environment (because normally my $PATH contains ~/.venv/bin, where ~/.venv is a virtualenv that has ansible 1.9.4 installed):
|
BTW /usr/share/ansible does not exist on my system. I used to have ansible apt-get installed, but then apt-get removed it, because it was too old. Hmmm. apt-get removed. Not purged. Which means
But no, removing those stale config files doesn't affect anything:
|
Clue: the warning disappears if I add a task like I've instrumented the Ansible source like this: diff --git a/lib/ansible/plugins/__init__.py b/lib/ansible/plugins/__init__.py
index 4def393..81c7230 100644
--- a/lib/ansible/plugins/__init__.py
+++ b/lib/ansible/plugins/__init__.py
@@ -304,6 +304,8 @@ class PluginLoader:
__contains__ = has_plugin
def _load_module_source(self, name, path):
+ import os
+ print(os.getpid(), "LOADING", name, "FROM", path)
with open(path, 'r') as module_file:
module = imp.load_source(name, path, module_file)
return module I see this:
And if I change the test.yml as follows: diff --git a/test.yml b/test.yml
index 7128b19..11cfff3 100644
--- a/test.yml
+++ b/test.yml
@@ -2,4 +2,5 @@
- hosts: localhost
gather_facts: no
tasks:
+ - command: echo hi
- example: Then I see this:
No warning. |
More clues:
With this I see
The warning shows up when Control group (with the extra
So when Ansible loads regular action plugins, it pre-imports the |
My mistake: #13114 doesn't fix this one. |
@mgedmin see the above, as I believe it may resolve this. |
Yes, I no longer get that warning on
|
Ansible Version: 2.0.0
Summary:
My custom ansible plugins cause warnings to be shown for every execution:
I've bisected this to commit 057712c.
You can look at my action plugin, if you're curious, but there's nothing special about it. Note how even
import time
causes the warning!The text was updated successfully, but these errors were encountered: