revert logging back to info, removed Rj45Models enum as it was not being used, updated linktypes enum to be used directly

This commit is contained in:
Blake Harnden 2020-03-10 22:48:05 -07:00
parent 1e8d1ecd9f
commit f277e96c9a
13 changed files with 12 additions and 22 deletions

View file

@ -80,7 +80,7 @@ def handle_link_event(event: LinkData) -> core_pb2.LinkEvent:
unidirectional=event.unidirectional,
)
link = core_pb2.Link(
type=event.link_type,
type=event.link_type.value,
node_one_id=event.node1_id,
node_two_id=event.node2_id,
interface_one=interface_one,

View file

@ -325,7 +325,7 @@ def convert_link(session: Session, link_data: LinkData) -> core_pb2.Link:
)
return core_pb2.Link(
type=link_data.link_type,
type=link_data.link_type.value,
node_one_id=link_data.node1_id,
node_two_id=link_data.node2_id,
interface_one=interface_one,

View file

@ -1501,7 +1501,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer):
flag = MessageFlags.DELETE.value
link = LinkData(
message_type=flag,
link_type=LinkTypes.WIRELESS.value,
link_type=LinkTypes.WIRELESS,
node1_id=node_one.id,
node2_id=node_two.id,
network_id=emane_one.id,

View file

@ -356,7 +356,7 @@ class CoreHandler(socketserver.BaseRequestHandler):
(LinkTlvs.BURST, link_data.burst),
(LinkTlvs.SESSION, link_data.session),
(LinkTlvs.MBURST, link_data.mburst),
(LinkTlvs.TYPE, link_data.link_type),
(LinkTlvs.TYPE, link_data.link_type.value),
(LinkTlvs.GUI_ATTRIBUTES, link_data.gui_attributes),
(LinkTlvs.UNIDIRECTIONAL, link_data.unidirectional),
(LinkTlvs.EMULATION_ID, link_data.emulation_id),

View file

@ -34,7 +34,7 @@ class EmaneNet(CoreNetworkBase):
"""
apitype = NodeTypes.EMANE.value
linktype = LinkTypes.WIRED.value
linktype = LinkTypes.WIRED
type = "wlan"
is_emane = True

View file

@ -86,16 +86,6 @@ class NodeTypes(Enum):
LXC = 16
class Rj45Models(Enum):
"""
RJ45 model types.
"""
LINKED = 0
WIRELESS = 1
INSTALLED = 2
# Link Message TLV Types
class LinkTlvs(Enum):
"""

View file

@ -577,7 +577,7 @@ class Session:
try:
# wireless link
if link_options.type == LinkTypes.WIRELESS.value:
if link_options.type == LinkTypes.WIRELESS:
raise CoreError("cannot update wireless link")
else:
if not node_one and not node_two:

View file

@ -499,7 +499,7 @@ class BasicRangeModel(WirelessModel):
node1_id=interface1.node.id,
node2_id=interface2.node.id,
network_id=self.wlan.id,
link_type=LinkTypes.WIRELESS.value,
link_type=LinkTypes.WIRELESS,
)
def sendlinkmsg(

View file

@ -982,7 +982,7 @@ class CoreNetworkBase(NodeBase):
Base class for networks
"""
linktype = LinkTypes.WIRED.value
linktype = LinkTypes.WIRED
is_emane = False
def __init__(

View file

@ -1030,7 +1030,7 @@ class WlanNode(CoreNetwork):
"""
apitype = NodeTypes.WIRELESS_LAN.value
linktype = LinkTypes.WIRED.value
linktype = LinkTypes.WIRED
policy = "DROP"
type = "wlan"

View file

@ -24,7 +24,7 @@ if TYPE_CHECKING:
def link_data_params(link_data: LinkData) -> Tuple[int, int, bool]:
node_one = link_data.node1_id
node_two = link_data.node2_id
is_wireless = link_data.link_type == LinkTypes.WIRELESS.value
is_wireless = link_data.link_type == LinkTypes.WIRELESS
return node_one, node_two, is_wireless

View file

@ -551,7 +551,7 @@ class Babel(QuaggaService):
@classmethod
def generatequaggaifcconfig(cls, node, ifc):
if ifc.net and ifc.net.linktype == LinkTypes.WIRELESS.value:
if ifc.net and ifc.net.linktype == LinkTypes.WIRELESS:
return " babel wireless\n no babel split-horizon\n"
else:
return " babel wired\n babel split-horizon\n"

View file

@ -14,7 +14,7 @@
}
},
"root": {
"level": "DEBUG",
"level": "INFO",
"handlers": ["console"]
}
}