Files

52 lines
3.8 KiB
Python
Raw Permalink Normal View History

2026-07-21 15:05:52 +03:00
"""Fixed text constants: banner, usage text, Sprut API base URL. Reproduced
verbatim from the bash original (ipsec_migrator_v2.sh) except for the
invocation name, which is "python -m ipsec_migrator" here instead of "$0"
since this port has no console-script entry point.
"""
SPRUT_API_BASE = "https://infra.mail.ru:9696/v2.0"
PROG = "python -m ipsec_migrator"
BANNER = r"""
██╗██████╗ ███████╗███████╗ ██████╗ ██╗ ██╗██████╗ ███╗ ██╗
██║██╔══██╗██╔════╝██╔════╝██╔════╝ ██║ ██║██╔══██╗████╗ ██║
██║██████╔╝███████╗█████╗ ██║ ██║ ██║██████╔╝██╔██╗ ██║
██║██╔═══╝ ╚════██║██╔══╝ ██║ ╚██╗ ██╔╝██╔═══╝ ██║╚██╗██║
██║██║ ███████║███████╗╚██████╗ ╚████╔╝ ██║ ██║ ╚████║
╚═╝╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═══╝
███╗ ███╗██╗ ██████╗ ██████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ██╗ ███████╗ ██████╗██████╗ ██╗██████╗ ████████╗
████╗ ████║██║██╔════╝ ██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗ ██║ ██╔════╝██╔════╝██╔══██╗██║██╔══██╗╚══██╔══╝
██╔████╔██║██║██║ ███╗██████╔╝███████║ ██║ ██║██║ ██║██╔██╗ ██║ ███████╗██║ ██████╔╝██║██████╔╝ ██║
██║╚██╔╝██║██║██║ ██║██╔══██╗██╔══██║ ██║ ██║██║ ██║██║╚██╗██║ ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║
██║ ╚═╝ ██║██║╚██████╔╝██║ ██║██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║ ███████║╚██████╗██║ ██║██║██║ ██║
╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝
Input file format:
<Nautron_Router_UUID>,<DC_Router_UUID>,<AZ_Name>,<Flavor_Name>
XXXX6d56-b2dc-4c83-b96f-e4e28af6XXXX,,MS1,standard
where DC_Router_UUID - optional (script will create a new one (DC_Router) if UUID won't be provided)
"""
USAGE = f"""
Usage:
Prepare input CSV file then use option:
1. Full run (audit Neutron + configure Sprut):
{PROG} <input.csv> [output.json] [--dry-run]
2. Audit only (collect Neutron VPNaaS config, write JSON, skip Sprut entirely):
{PROG} --audit-only <input.csv> [output.json]
3. Configure Sprut from a previously generated audit JSON (no OpenStack re-query):
{PROG} --from-audit <audit.json> [--dry-run]
"""