|
|
|
@ -84,6 +84,7 @@ if t.TYPE_CHECKING:
|
|
|
|
FileManifestEntryType = t.Dict[FileMetaKeysType, t.Union[str, int, None]]
|
|
|
|
FileManifestEntryType = t.Dict[FileMetaKeysType, t.Union[str, int, None]]
|
|
|
|
FilesManifestType = t.Dict[t.Literal['files', 'format'], t.Union[t.List[FileManifestEntryType], int]]
|
|
|
|
FilesManifestType = t.Dict[t.Literal['files', 'format'], t.Union[t.List[FileManifestEntryType], int]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import ansible
|
|
|
|
import ansible.constants as C
|
|
|
|
import ansible.constants as C
|
|
|
|
from ansible.errors import AnsibleError
|
|
|
|
from ansible.errors import AnsibleError
|
|
|
|
from ansible.galaxy.api import GalaxyAPI
|
|
|
|
from ansible.galaxy.api import GalaxyAPI
|
|
|
|
@ -143,6 +144,8 @@ ModifiedContent = namedtuple('ModifiedContent', ['filename', 'expected', 'instal
|
|
|
|
|
|
|
|
|
|
|
|
SIGNATURE_COUNT_RE = r"^(?P<strict>\+)?(?:(?P<count>\d+)|(?P<all>all))$"
|
|
|
|
SIGNATURE_COUNT_RE = r"^(?P<strict>\+)?(?:(?P<count>\d+)|(?P<all>all))$"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_ANSIBLE_PACKAGE_PATH = pathlib.Path(ansible.__file__).parent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
@dataclass
|
|
|
|
class ManifestControl:
|
|
|
|
class ManifestControl:
|
|
|
|
@ -1429,9 +1432,12 @@ def find_existing_collections(path_filter, artifacts_manager, namespace_filter=N
|
|
|
|
paths = set()
|
|
|
|
paths = set()
|
|
|
|
for path in files('ansible_collections').glob('*/*/'):
|
|
|
|
for path in files('ansible_collections').glob('*/*/'):
|
|
|
|
path = _normalize_collection_path(path)
|
|
|
|
path = _normalize_collection_path(path)
|
|
|
|
if not path.is_dir():
|
|
|
|
if path.is_relative_to(_ANSIBLE_PACKAGE_PATH):
|
|
|
|
|
|
|
|
# skip internal path, those collections are not for galaxy use
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
elif not path.is_dir():
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
if path_filter:
|
|
|
|
elif path_filter:
|
|
|
|
for pf in path_filter:
|
|
|
|
for pf in path_filter:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
path.relative_to(_normalize_collection_path(pf))
|
|
|
|
path.relative_to(_normalize_collection_path(pf))
|
|
|
|
|