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

ifupdown2 2.0.0-1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2019-12-17 01:04:54 +01:00
parent 8ebee96099
commit 223ba5af1d
68 changed files with 12533 additions and 9450 deletions

View File

@@ -15,6 +15,7 @@ import signal
import logging
import subprocess
from string import maketrans
from functools import partial
from ipaddr import IPNetwork, IPAddress
@@ -103,6 +104,7 @@ class utils():
systemctl_cmd = '/bin/systemctl'
dpkg_cmd = '/usr/bin/dpkg'
logger.info("utils init command paths")
for cmd in ['bridge',
'ip',
'brctl',
@@ -130,6 +132,17 @@ class utils():
else:
logger.debug('warning: path %s not found: %s won\'t be usable' % (path + cmd, cmd))
mac_translate_tab = maketrans(":.-,", " ")
@classmethod
def mac_str_to_int(cls, hw_address):
mac = 0
if hw_address:
for i in hw_address.translate(cls.mac_translate_tab).split():
mac = mac << 8
mac += int(i, 16)
return mac
@staticmethod
def get_onff_from_onezero(value):
if value in utils._onoff_onezero: