File: system_ssh_args.py

package info (click to toggle)
python-scrapli 2023.7.30-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,536 kB
  • sloc: python: 14,459; makefile: 72
file content (27 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""examples.transport_options.system_ssh_args"""
from scrapli.driver.core import IOSXEDriver

MY_DEVICE = {
    "host": "172.18.0.11",
    "auth_username": "scrapli",
    "auth_password": "scrapli",
    "auth_strict_key": False,
    "transport_options": {"open_cmd": ["-o", "KexAlgorithms=+diffie-hellman-group1-sha1"]},
}


def main():
    """Simple example demonstrating adding transport options"""
    conn = IOSXEDriver(**MY_DEVICE)
    # with the transport options provided, we can extend the open command to include extra args
    print(conn.transport.open_cmd)

    # deleting the transport options we can see what the default open command would look like
    MY_DEVICE.pop("transport_options")
    del conn
    conn = IOSXEDriver(**MY_DEVICE)
    print(conn.transport.open_cmd)


if __name__ == "__main__":
    main()