Created
November 25, 2025 21:51
-
-
Save quiiver/f2d91f6c9bf8c59f587e71d907902dd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git i/misc/scripts/tenant-managment/src/main.py w/misc/scripts/tenant-managment/src/main.py | |
| index dd47e72a..8b487600 100644 | |
| --- i/misc/scripts/tenant-managment/src/main.py | |
| +++ w/misc/scripts/tenant-managment/src/main.py | |
| @@ -83,18 +83,25 @@ def simplify_schema(schema_path): | |
| help="Path to the tenant file", | |
| type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path), | |
| ) | |
| -def migrate_tenants(schema_path: Path, tenant_path: Optional[Path]): | |
| +@click.option( | |
| + "--tenant-dir", | |
| + default=None, | |
| + help="Path to the tenant directory", | |
| + type=click.Path(exists=True, file_okay=False, dir_okay=True, path_type=Path), | |
| +) | |
| +def migrate_tenants(schema_path: Path, tenant_path: Optional[Path], tenant_dir: Optional[Path]): | |
| """Migrate tenant files to match updated schema.""" | |
| with open(schema_path, "r") as f: | |
| schema = json.load(f) | |
| # update tenant files to match new schema | |
| + tenant_dir = tenant_dir or schema_path.parent | |
| if tenant_path: | |
| update_tenant_file(tenant_path, schema) | |
| else: | |
| - for tenant_file in os.listdir(schema_path.parent): | |
| + for tenant_file in os.listdir(tenant_dir): | |
| if tenant_file.endswith(".yaml"): | |
| - tenant_path = schema_path.parent / tenant_file | |
| + tenant_path = tenant_dir / tenant_file | |
| update_tenant_file(tenant_path, schema) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment