Skip to content

sync_driver

scrapli_community.ruckus.unleashed.sync_driver

default_sync_on_close(conn: NetworkDriver) -> None

ruckus_unleashed default on_close callable

Parameters:

Name Type Description Default
conn NetworkDriver

NetworkDriver object

required

Returns:

Type Description
None

N/A

Source code in ruckus/unleashed/sync_driver.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def default_sync_on_close(conn: NetworkDriver) -> None:
    """
    ruckus_unleashed default on_close callable

    Args:
        conn: NetworkDriver object

    Returns:
        N/A

    Raises:
        N/A
    """
    conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)
    conn.channel.write(channel_input="exit")
    conn.channel.send_return()

default_sync_on_open(conn: NetworkDriver) -> None

ruckus_unleashed default on_open callable

Parameters:

Name Type Description Default
conn NetworkDriver

NetworkDriver object

required

Returns:

Type Description
None

N/A

Source code in ruckus/unleashed/sync_driver.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def default_sync_on_open(conn: NetworkDriver) -> None:
    """
    ruckus_unleashed default on_open callable

    Args:
        conn: NetworkDriver object

    Returns:
        N/A

    Raises:
        N/A
    """
    # Since Ruckus Unleashed devices do not use true SSH authentication, after the initial
    # connection is established, authentication is handled using Scrapli's built-in telnet
    # authentication:
    # https://github.com/carlmontanari/scrapli/blob/main/scrapli/channel/sync_channel.py#L327
    # Auth Bypass Reference:
    # https://carlmontanari.github.io/scrapli/user_guide/advanced_usage/#auth-bypass
    conn.channel.channel_authenticate_telnet(
        auth_username=conn.auth_username, auth_password=conn.auth_password
    )
    conn.acquire_priv(desired_priv=conn.default_desired_privilege_level)