daemon: refactored CoreInterface.mac from a string to a netaddr.EUI object, providing more functionality

This commit is contained in:
Blake Harnden 2020-06-19 15:21:45 -07:00
parent cfda9509a2
commit 1829a8e2f8
8 changed files with 25 additions and 23 deletions

View file

@ -230,9 +230,9 @@ def build_node_platform_xml(
platform_element.append(nem_element)
node.setnemid(iface, nem_id)
macstr = _MAC_PREFIX + ":00:00:"
macstr += f"{(nem_id >> 8) & 0xFF:02X}:{nem_id & 0xFF:02X}"
iface.set_mac(macstr)
mac = _MAC_PREFIX + ":00:00:"
mac += f"{(nem_id >> 8) & 0xFF:02X}:{nem_id & 0xFF:02X}"
iface.set_mac(mac)
# increment nem id
nem_id += 1