Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion ifupdown2/addons/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,28 @@
import time
import subprocess

from setuptools.dist import strtobool
_BOOLSTRS = {
'y': True,
'yes': True,
't': True,
'true': True,
'on': True,
'1': True,
'n': False,
'no': False,
'f': False,
'false': False,
'off': False,
'0': False
}


def strtobool(value):
try:
return _BOOLSTRS[str(value).lower()]
except KeyError:
raise ValueError('"{}" is not a valid bool value'.format(value))


try:
from ifupdown2.lib.addon import AddonWithIpBlackList
Expand Down