Skip to content

Commit

Permalink
allow parallel telnet and netconf connections
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-sahlmann committed Nov 1, 2023
1 parent e96194b commit ab6617a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mb_netmgmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with mb-netmgmt. If not, see <https://www.gnu.org/licenses/

"""Network Management Protocols for Mountebank"""
__version__ = "0.0.73"
__version__ = "0.0.74"

import os
import subprocess
Expand Down
2 changes: 1 addition & 1 deletion mb_netmgmt/netconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import logging
from socketserver import BaseRequestHandler
from socketserver import TCPServer as Server
from socketserver import ThreadingTCPServer as Server

from lxml import etree
from ncclient.devices.default import DefaultDeviceHandler
Expand Down
5 changes: 2 additions & 3 deletions mb_netmgmt/telnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
import re
import telnetlib
import time
from socketserver import StreamRequestHandler, TCPServer
from socketserver import StreamRequestHandler
from socketserver import ThreadingTCPServer as Server

from mb_netmgmt.__main__ import Protocol, get_cli_patterns

Server = TCPServer


class Handler(StreamRequestHandler, Protocol):
def handle(self):
Expand Down
4 changes: 2 additions & 2 deletions test/test_mb_netmgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_netconf_default_response():
def test_netconf_private_key():
with mb(
[
{"protocol": "netconf", "port": 830, "stubs": []},
{"protocol": "netconf", "port": 8832, "stubs": []},
{
"protocol": "netconf",
"port": port,
Expand All @@ -199,7 +199,7 @@ def test_netconf_private_key():
"responses": [
{
"proxy": {
"to": f"netconf://{os.environ['NETCONF_USERNAME']}@localhost",
"to": f"netconf://{os.environ['NETCONF_USERNAME']}@localhost:8832",
"key": os.environ["NETCONF_KEY"],
}
},
Expand Down

0 comments on commit ab6617a

Please sign in to comment.