C1: persistent SSH connection pool, C2: TextFSM structured output

C1 — Persistent connection pool:
- Added CISCO_SWITCH_PERSISTENT_CONNECTION setting (default false)
- Added get_connection() / close_connection() with thread-safe locking
- run_command(), run_config_commands(), and test_connection() all honour persistent mode
- Added cisco_switch_reconnect() tool to force a fresh connection

C2 — TextFSM structured output:
- Added run_command_structured() that tries TextFSM, falls back to raw JSON-wrapped text
- Updated 6 diagnostic tools to return structured JSON:
  show_version, show_interfaces_status, show_mac_address_table,
  show_vlan_brief, show_ip_route, show_cdp_neighbors
- Added cisco_switch_test_connection_structured() tool
- Added cisco_switch_get_mcp_config() alias
- Added .gitignore for __pycache__ and build artifacts
This commit is contained in:
root
2026-07-04 20:41:26 +00:00
parent 68e87cf6a5
commit 468d4dd6fd
8 changed files with 209 additions and 24 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
__pycache__/
*.pyc
*.pyo
*.egg-info/
dist/
build/
.eggs/