14 lines
508 B
Python
14 lines
508 B
Python
"""Switch connection config, read from environment variables.
|
|
|
|
These three settings (host, https, password) are exactly what a future
|
|
Terraform provider config block would need per-switch -- see AGENT.md.
|
|
"""
|
|
|
|
import os
|
|
|
|
SWITCH_HOST = os.environ.get("SWITCH_HOST", "192.168.2.10")
|
|
SWITCH_HTTPS = os.environ.get("SWITCH_HTTPS", "false").strip().lower() in ("1", "true", "yes")
|
|
SWITCH_PASSWORD = os.environ.get("SWITCH_PASSWORD", "")
|
|
|
|
SWITCH_BASE_URL = f"{'https' if SWITCH_HTTPS else 'http'}://{SWITCH_HOST}"
|