grpc: added check for emane pathloss when nem id is None and throw an error

This commit is contained in:
Blake Harnden 2020-06-23 13:34:40 -07:00
parent 9649337f18
commit 7215f852b8

View file

@ -487,4 +487,8 @@ def get_nem_id(node: CoreNode, iface_id: int, context: ServicerContext) -> int:
if not isinstance(net, EmaneNet):
message = f"{node.name} interface {iface_id} is not an EMANE network"
context.abort(grpc.StatusCode.INVALID_ARGUMENT, message)
return net.getnemid(iface)
nem_id = net.getnemid(iface)
if nem_id is None:
message = f"{node.name} interface {iface_id} nem id does not exist"
context.abort(grpc.StatusCode.INVALID_ARGUMENT, message)
return nem_id