INNER CODE UNIT · Python
resource_addresses
floci-io/floci · .github/ci/compat-opentofu-drift-check.py:35
def resource_addresses(path):
return {f'{t}.{n}' for t, n in RESOURCE_RE.findall(path.read_text())}
def load_allowlist(path):
if not path.exists():
return set()
addrs = set()
for line in path.read_text().splitlines():
addr = line.split('#', 1)[0].strip()
if addr:
addrs.add(addr)
return addrs
def check_direction(label, only_in, allowlist_path):
"""Report unexpected and stale entries for one direction. Returns True if clean."""
allowed = load_allowlist(allowlist_path)