diff --git a/ifupdown2/addons/address.py b/ifupdown2/addons/address.py index e71a26f7..651a662e 100644 --- a/ifupdown2/addons/address.py +++ b/ifupdown2/addons/address.py @@ -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