1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

python3: 2to3 changes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2019-12-17 16:55:49 +01:00
parent 35681c0608
commit 3b01ed7618
41 changed files with 479 additions and 488 deletions

View File

@@ -15,7 +15,6 @@ import signal
import logging
import subprocess
from string import maketrans
from functools import partial
from ipaddr import IPNetwork, IPAddress
@@ -132,12 +131,13 @@ class utils():
else:
logger.debug('warning: path %s not found: %s won\'t be usable' % (path + cmd, cmd))
mac_translate_tab = maketrans(":.-,", " ")
mac_translate_tab = str.maketrans(":.-,", " ")
@classmethod
def mac_str_to_int(cls, hw_address):
mac = 0
if hw_address:
pass
for i in hw_address.translate(cls.mac_translate_tab).split():
mac = mac << 8
mac += int(i, 16)