INNER CODE UNIT · Python
dependencies
spantaleev/matrix-docker-ansible-deploy · bin/molecule-select-roles.py:120
def dependencies(snapshot, role):
"""Return file and variable dependencies, following shared files and symlinks.
Scan all scenario files, including nested tasks and fixtures. Ignore full-line
comments. Do not scan vars.yml's definitions: loading the mapping does not
mean a scenario uses every image in it.
"""
pending = [path for path in snapshot if path.startswith(f"roles/custom/{role}/molecule/")]
files, variables = set(), set()
while pending:
path = pending.pop()
if path in files:
continue
files.add(path)
if path not in snapshot:
raise Uncertain(f"Unresolved dependency: {path}")
mode, content = snapshot[path]
if mode == "120000":