This commit is contained in:
parent
d9b15aea0d
commit
d699d32553
@ -647,9 +647,10 @@ def get_system_mac(namespace=None):
|
|||||||
|
|
||||||
# Align last byte of MAC if necessary
|
# Align last byte of MAC if necessary
|
||||||
if version_info and version_info['asic_type'] == 'centec':
|
if version_info and version_info['asic_type'] == 'centec':
|
||||||
last_byte = mac[-2:]
|
mac_tmp = mac.replace(':','')
|
||||||
aligned_last_byte = format(int(int(last_byte, 16) + 1), '02x')
|
mac_tmp = "{:012x}".format(int(mac_tmp, 16) + 1)
|
||||||
mac = mac[:-2] + aligned_last_byte
|
mac_tmp = re.sub("(.{2})", "\\1:", mac_tmp, 0, re.DOTALL)
|
||||||
|
mac = mac_tmp[:-1]
|
||||||
return mac
|
return mac
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user