14 lines
702 B
Python
14 lines
702 B
Python
#!/usr/bin/env python3
|
|
import sys, pathlib, re, os
|
|
runtime=pathlib.Path(sys.argv[1] if len(sys.argv)>1 else os.environ.get('AIOS_RUNTIME_ROOT','.')).resolve(); legacy=re.compile(r'\b(ultra|pro|regular)\b',re.I); viol=[]
|
|
for base in [runtime/'webops']:
|
|
if base.exists():
|
|
for p in base.rglob('*'):
|
|
if p.is_file() and p.suffix.lower() in ['.py','.sh','.yaml','.yml','.json','.env','.md','.html','.js','.sql']:
|
|
s=p.read_text(errors='ignore')
|
|
if 'legacy_role_mapping' in s: continue
|
|
if legacy.search(s): viol.append(str(p))
|
|
if viol:
|
|
print('LEGACY_ROLE_REFERENCES_FOUND'); print('\n'.join(viol[:20])); raise SystemExit(2)
|
|
print('NO_LEGACY_ROLES_IN_ACTIVE_OVERLAY_OK')
|