grpc will now always be ran, but can be configured through command line or core.conf
This commit is contained in:
parent
c5ce85b235
commit
e298a2a5c1
2 changed files with 8 additions and 11 deletions
|
@ -4,7 +4,7 @@ url = "https://pypi.org/simple"
|
|||
verify_ssl = true
|
||||
|
||||
[scripts]
|
||||
core = "python scripts/core-daemon -f data/core.conf -l data/logging.conf --grpc"
|
||||
core = "python scripts/core-daemon -f data/core.conf -l data/logging.conf"
|
||||
test = "pytest -v tests"
|
||||
test_emane = "pytest -v tests/emane"
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ from core.api.grpc.server import CoreGrpcServer
|
|||
from core.api.tlv.corehandlers import CoreHandler, CoreUdpHandler
|
||||
from core.api.tlv.coreserver import CoreServer, CoreUdpServer
|
||||
from core.constants import CORE_CONF_DIR, COREDPY_VERSION
|
||||
from core.emulator import enumerations
|
||||
from core.emulator.enumerations import CORE_API_PORT
|
||||
from core.utils import close_onexec, load_logging_config
|
||||
|
||||
|
@ -67,14 +66,13 @@ def cored(cfg):
|
|||
sys.exit(1)
|
||||
|
||||
# initialize grpc api
|
||||
if cfg["grpc"] == "True":
|
||||
grpc_server = CoreGrpcServer(server.coreemu)
|
||||
address_config = cfg["grpcaddress"]
|
||||
port_config = cfg["grpcport"]
|
||||
grpc_address = f"{address_config}:{port_config}"
|
||||
grpc_thread = threading.Thread(target=grpc_server.listen, args=(grpc_address,))
|
||||
grpc_thread.daemon = True
|
||||
grpc_thread.start()
|
||||
grpc_server = CoreGrpcServer(server.coreemu)
|
||||
address_config = cfg["grpcaddress"]
|
||||
port_config = cfg["grpcport"]
|
||||
grpc_address = f"{address_config}:{port_config}"
|
||||
grpc_thread = threading.Thread(target=grpc_server.listen, args=(grpc_address,))
|
||||
grpc_thread.daemon = True
|
||||
grpc_thread.start()
|
||||
|
||||
# start udp server
|
||||
start_udp(server, address)
|
||||
|
@ -117,7 +115,6 @@ def get_merged_config(filename):
|
|||
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", action="store_true", help="enable grpc api, default is false")
|
||||
parser.add_argument("--grpc-port", dest="grpcport",
|
||||
help=f"grpc port to listen on; default {default_grpc_port}")
|
||||
parser.add_argument("--grpc-address", dest="grpcaddress",
|
||||
|
|
Loading…
Reference in a new issue