Skip to content

transport

scrapli_netconf.transport.plugins.ssh2.transport

NetconfSsh2Transport

Bases: Ssh2Transport

Source code in transport/plugins/ssh2/transport.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class NetconfSsh2Transport(Ssh2Transport):
    def open_netconf(self) -> bytes:
        """
        Netconf open method

        Simply calls the "normal" open method, but retaining an explicit "netconf" open for sanity

        Args:
            N/A

        Returns:
            None

        Raises:
            N/A

        """
        super().open()

        return b""

    def _open_channel(self) -> None:
        """
        Overriding the base open_channel to invoke netconf subsystem

        Args:
            N/A

        Returns:
            None

        Raises:
            ScrapliConnectionNotOpened: if session is unopened/None

        """
        if not self.session:
            raise ScrapliConnectionNotOpened

        self.session_channel = self.session.open_session()
        self.session_channel.subsystem("netconf")

open_netconf() -> bytes

Netconf open method

Simply calls the "normal" open method, but retaining an explicit "netconf" open for sanity

Returns:

Type Description
bytes

None

Source code in transport/plugins/ssh2/transport.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def open_netconf(self) -> bytes:
    """
    Netconf open method

    Simply calls the "normal" open method, but retaining an explicit "netconf" open for sanity

    Args:
        N/A

    Returns:
        None

    Raises:
        N/A

    """
    super().open()

    return b""