🎉 no more warnings, only load specific collection subdirs instead of top-level collection path (ie no ansible_collections/google, only ansible_collections/google/cloud, etc)

pull/715/head
Steven Robertson 4 years ago
parent 741e99f698
commit 196a476270

@ -43,8 +43,7 @@ import os
import random import random
from ansible.executor import module_common from ansible.executor import module_common
from ansible.galaxy.collection import find_existing_collections from ansible.collections.list import list_collection_dirs
from ansible.utils.collection_loader import AnsibleCollectionConfig
import ansible.errors import ansible.errors
import ansible.module_utils import ansible.module_utils
import ansible.release import ansible.release
@ -572,12 +571,8 @@ def _load_collections(invocation):
Goes through all collection path possibilities and stores paths to installed collections Goes through all collection path possibilities and stores paths to installed collections
Stores them on the current invocation to later be passed to the master service Stores them on the current invocation to later be passed to the master service
""" """
for path in AnsibleCollectionConfig.collection_paths: for collection_path in list_collection_dirs():
if os.path.isdir(path): invocation._extra_sys_paths.add(collection_path.decode('utf-8'))
collections = find_existing_collections(path, fallback_metadata=True)
for collection in collections:
invocation._extra_sys_paths.add(collection.b_path.decode('utf-8'))
def invoke(invocation): def invoke(invocation):

Loading…
Cancel
Save