| 775 | |
| 776 | |
| 777 | def get_endpoint(endpoint_name: str): |
| 778 | endpoints_config = os.getenv("REDIS_ENDPOINTS_CONFIG_PATH", None) |
| 779 | |
| 780 | if not (endpoints_config and os.path.exists(endpoints_config)): |
| 781 | raise FileNotFoundError(f"Endpoints config file not found: {endpoints_config}") |
| 782 | |
| 783 | try: |
| 784 | with open(endpoints_config, "r") as f: |
| 785 | data = json.load(f) |
| 786 | db = data[endpoint_name] |
| 787 | return db["endpoints"][0] |
| 788 | except Exception as e: |
| 789 | raise ValueError( |
| 790 | f"Failed to load endpoints config file: {endpoints_config}" |
| 791 | ) from e |
| 792 | |
| 793 | |
| 794 | def wait_for_command(client, monitor, command, key=None): |