Gets the initialized MSF client instance, raising an error if not ready.
()
| 104 | raise RuntimeError(f"Unexpected error initializing MSF client: {e}") from e |
| 105 | |
| 106 | def get_msf_client() -> MsfRpcClient: |
| 107 | """Gets the initialized MSF client instance, raising an error if not ready.""" |
| 108 | if _msf_client_instance is None: |
| 109 | logger.error("Metasploit client has not been initialized. Check MSF server connection.") |
| 110 | raise ConnectionError("Metasploit client has not been initialized.") # Strict check preferred |
| 111 | logger.debug("Retrieved MSF client instance successfully.") |
| 112 | return _msf_client_instance |
| 113 | |
| 114 | async def check_msf_connection() -> Dict[str, Any]: |
| 115 | """ |
no outgoing calls