As the packages to be imported by a python file are prefixed as "ansible_collections.", how can we then locally debug an Ansible Module
from ansible_collections.community.kubernetes.plugins.module_utils.common import KubernetesAnsibleModule
...
class KubernetesLogModule(KubernetesAnsibleModule):
def __init__(self, *args, **kwargs):
KubernetesAnsibleModule.__init__(self, *args,
supports_check_mode=True,
**kwargs)
/usr/local/bin/python3.7 "/Users/cmoullia/Library/Application Support/JetBrains/IntelliJIdea2020.1/plugins/python/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 57135 --file /Users/cmoullia/code/ansible/community.kubernetes/plugins/modules/k8s_log.py
pydev debugger: process 68087 is connecting
Connected to pydev debugger (build 201.8538.31)
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ModuleNotFoundError: No module named 'ansible_collections'