changes to replace MacAddress usage and remove ipaddress module altogether

This commit is contained in:
Blake Harnden 2020-01-08 17:33:49 -08:00
parent 4db7f845a5
commit de493c810a
11 changed files with 43 additions and 83 deletions

View file

@ -9,8 +9,8 @@ from contextlib import contextmanager
import grpc
import netaddr
from core import utils
from core.api.grpc import core_pb2, core_pb2_grpc
from core.nodes.ipaddress import MacAddress
class InterfaceHelper:
@ -88,7 +88,7 @@ class InterfaceHelper:
# random mac
if not mac:
mac = MacAddress.random()
mac = utils.random_mac()
return core_pb2.Interface(
id=interface_id,

View file

@ -6,7 +6,6 @@ from core.api.grpc import core_pb2
from core.emulator.emudata import InterfaceData, LinkOptions, NodeOptions
from core.emulator.enumerations import LinkTypes, NodeTypes
from core.nodes.base import CoreNetworkBase
from core.nodes.ipaddress import MacAddress
WORKERS = 10
@ -57,8 +56,6 @@ def link_interface(interface_proto):
mac = interface_proto.mac
if mac == "":
mac = None
else:
mac = MacAddress.from_string(mac)
interface = InterfaceData(
_id=interface_proto.id,
name=name,