removed configuration option for number of for corehandler threads as it cannot properly deal with anything more than 1, updated man pages to current 6.4 versions for now
This commit is contained in:
parent
75d5bced9c
commit
bf1bc511e2
18 changed files with 47 additions and 65 deletions
|
@ -79,15 +79,9 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
|||
self._sessions_lock = threading.Lock()
|
||||
|
||||
self.handler_threads = []
|
||||
num_threads = int(server.config["numthreads"])
|
||||
if num_threads < 1:
|
||||
raise ValueError(f"invalid number of threads: {num_threads}")
|
||||
|
||||
logging.debug("launching core server handler threads: %s", num_threads)
|
||||
for _ in range(num_threads):
|
||||
thread = threading.Thread(target=self.handler_thread)
|
||||
self.handler_threads.append(thread)
|
||||
thread.start()
|
||||
thread = threading.Thread(target=self.handler_thread, daemon=True)
|
||||
thread.start()
|
||||
self.handler_threads.append(thread)
|
||||
|
||||
self.session = None
|
||||
self.coreemu = server.coreemu
|
||||
|
|
|
@ -4,7 +4,6 @@ listenaddr = localhost
|
|||
port = 4038
|
||||
grpcaddress = localhost
|
||||
grpcport = 50051
|
||||
numthreads = 1
|
||||
quagga_bin_search = "/usr/local/bin /usr/bin /usr/lib/quagga"
|
||||
quagga_sbin_search = "/usr/local/sbin /usr/sbin /usr/lib/quagga"
|
||||
frr_bin_search = "/usr/local/bin /usr/bin /usr/lib/frr"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
core-daemon: the CORE daemon is a server process that receives CORE API
|
||||
messages and instantiates emulated nodes and networks within the kernel. Various
|
||||
|
@ -93,12 +93,10 @@ def get_merged_config(filename):
|
|||
# these are the defaults used in the config file
|
||||
default_log = os.path.join(constants.CORE_CONF_DIR, "logging.conf")
|
||||
default_grpc_port = "50051"
|
||||
default_threads = "1"
|
||||
default_address = "localhost"
|
||||
defaults = {
|
||||
"port": str(CORE_API_PORT),
|
||||
"listenaddr": default_address,
|
||||
"numthreads": default_threads,
|
||||
"grpcport": default_grpc_port,
|
||||
"grpcaddress": default_address,
|
||||
"logfile": default_log
|
||||
|
@ -110,8 +108,6 @@ def get_merged_config(filename):
|
|||
help=f"read config from specified file; default = {filename}")
|
||||
parser.add_argument("-p", "--port", dest="port", type=int,
|
||||
help=f"port number to listen on; default = {CORE_API_PORT}")
|
||||
parser.add_argument("-n", "--numthreads", dest="numthreads", type=int,
|
||||
help=f"number of server threads; default = {default_threads}")
|
||||
parser.add_argument("--ovs", action="store_true", help="enable experimental ovs mode, default is false")
|
||||
parser.add_argument("--grpc-port", dest="grpcport",
|
||||
help=f"grpc port to listen on; default {default_grpc_port}")
|
||||
|
@ -148,14 +144,9 @@ def main():
|
|||
|
||||
:return: nothing
|
||||
"""
|
||||
# get a configuration merged from config file and command-line arguments
|
||||
cfg = get_merged_config(f"{CORE_CONF_DIR}/core.conf")
|
||||
|
||||
# load logging configuration
|
||||
load_logging_config(cfg["logfile"])
|
||||
|
||||
banner()
|
||||
|
||||
try:
|
||||
cored(cfg)
|
||||
except KeyboardInterrupt:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
core-manage: Helper tool to add, remove, or check for services, models, and
|
||||
node types in a CORE installation.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import logging
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import enum
|
||||
import select
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import re
|
||||
from io import TextIOWrapper
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
coresendmsg: utility for generating CORE messages
|
||||
"""
|
||||
|
|
|
@ -44,8 +44,8 @@ class PatchManager:
|
|||
|
||||
|
||||
class MockServer:
|
||||
def __init__(self, config, coreemu):
|
||||
self.config = config
|
||||
def __init__(self, coreemu):
|
||||
self.config = {}
|
||||
self.coreemu = coreemu
|
||||
|
||||
|
||||
|
@ -108,7 +108,7 @@ def module_grpc(global_coreemu):
|
|||
def module_coretlv(patcher, global_coreemu, global_session):
|
||||
request_mock = MagicMock()
|
||||
request_mock.fileno = MagicMock(return_value=1)
|
||||
server = MockServer({"numthreads": "1"}, global_coreemu)
|
||||
server = MockServer(global_coreemu)
|
||||
request_handler = CoreHandler(request_mock, "", server)
|
||||
request_handler.session = global_session
|
||||
request_handler.add_session_handlers()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue