feat(gns3-copilot): add get_gns3_server_host utility and integrate into Nornir tools

- Add `get_gns3_server_host()` function to `connector_factory.py` for extracting GNS3 server hostname from controller, config, or default URL
- Export new function in `__init__.py` for public API access
- Replace `os.getenv("GNS3_SERVER_HOST", "127.0.0.1")` calls with `get_gns3_server_host()` in Nornir configuration tools (`config_tools_nornir.py`, `display_tools_nornir.py`)
- Ensures consistent host detection across tools using the same priority logic as `get_gns3_connector`
This commit is contained in:
YueGuobin committed 2026-03-04 00:28:52 +08:00
1 parent 8917ef39c9
commit cabcf4f1cb
7 files changed
+54 -1390

No files matched your search

@@ -27,7 +27,11 @@ Main functions:
- get_gns3_connector_with_llm_config: Factory function to create connector AND retrieve LLM config
"""
from .connector_factory import get_gns3_connector, get_gns3_connector_with_llm_config
from .connector_factory import (
get_gns3_connector,
get_gns3_connector_with_llm_config,
get_gns3_server_host,
)
from .custom_gns3fy import (
CONSOLE_TYPES,
LINK_TYPES,
@@ -93,6 +97,7 @@ __all__ = [
"GNS3UpdateDrawingTool",
"get_gns3_connector",
"get_gns3_connector_with_llm_config",
"get_gns3_server_host",
"add_file_to_index",
"get_file_list",
]