Load and validate cephadm bootstrap config from a JSON file. Raises FileNotFoundError if path does not exist, ValueError if invalid.
(path: str)
| 54 | |
| 55 | |
| 56 | def load_cephadm_config(path: str) -> CephadmConfig: |
| 57 | """ |
| 58 | Load and validate cephadm bootstrap config from a JSON file. |
| 59 | Raises FileNotFoundError if path does not exist, ValueError if invalid. |
| 60 | """ |
| 61 | if not os.path.exists(path): |
| 62 | raise FileNotFoundError(f"Config file not found: {path}") |
| 63 | with open(path, "r") as f: |
| 64 | try: |
| 65 | data = json.load(f) |
| 66 | except json.JSONDecodeError as e: |
| 67 | raise ValueError(f"Invalid JSON config: {e}") from e |
| 68 | if not isinstance(data, dict): |
| 69 | raise ValueError("Config must be a JSON object") |
| 70 | return CephadmConfig.from_dict(data) |
| 71 | |
| 72 | |
| 73 | def get_node_proxy_config( |