23 lines
461 B
Python
23 lines
461 B
Python
# --- shared.py ---
|
|
import asyncio
|
|
|
|
DEBUG_MODE = False
|
|
|
|
def debug_print(msg: str):
|
|
if DEBUG_MODE:
|
|
print(msg)
|
|
|
|
# 預設的 CMTS 連線樣板
|
|
CMTS_DEVICE = {
|
|
'device_type': 'cisco_ios',
|
|
'host': '10.14.110.4',
|
|
'username': 'admin',
|
|
'password': 'nsgadmin',
|
|
'port': 22,
|
|
'fast_cli': False,
|
|
'global_delay_factor': 2
|
|
}
|
|
|
|
# 全域非同步鎖:確保同一時間只有一人能執行設定寫入
|
|
cmts_config_lock = asyncio.Lock()
|