1
0
Fork 0

Merge pull request #228 from yarda/base-plugin-options-parser-fix

unit: accept "True" for replace and enabled options
This commit is contained in:
Jaroslav Škarvada 2019-11-27 16:49:33 +01:00 committed by GitHub
commit b5fbf47ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,8 +11,8 @@ class Unit(object):
def __init__(self, name, config):
self._name = name
self._type = config.pop("type", self._name)
self._enabled = config.pop("enabled", True) in [True, "true", 1, "1"]
self._replace = config.pop("replace", False) in [True, "true", 1, "1"]
self._enabled = config.pop("enabled", True) in [True, "True", "true", 1, "1"]
self._replace = config.pop("replace", False) in [True, "True", "true", 1, "1"]
self._devices = config.pop("devices", "*")
self._devices_udev_regex = config.pop("devices_udev_regex", None)
self._cpuinfo_regex = config.pop("cpuinfo_regex", None)