small fixes

This commit is contained in:
əlemi 2022-05-23 01:45:04 +02:00
parent 5f2beac41b
commit 79886a2c64
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E
2 changed files with 3 additions and 2 deletions

View file

@ -15,7 +15,8 @@ from dataclasses import dataclass, MISSING, fields
from setproctitle import setproctitle from setproctitle import setproctitle
from .treepuncher import Treepuncher, MissingParameterError, Addon, ConfigObject, Provider from .treepuncher import Treepuncher, MissingParameterError, Addon, Provider
from .scaffold import ConfigObject
from .helpers import configure_logging from .helpers import configure_logging
def main(): def main():

View file

@ -59,7 +59,7 @@ class Treepuncher(
v = kwargs.get(k) or self.cfg.get(k) or default v = kwargs.get(k) or self.cfg.get(k) or default
if not v and required: if not v and required:
raise MissingParameterError(f"Missing configuration parameter '{k}'") raise MissingParameterError(f"Missing configuration parameter '{k}'")
if t is bool and v.lower().strip() == 'false': # hardcoded special case if t is bool and isinstance(v, str) and v.lower().strip() == 'false': # hardcoded special case
return False return False
return t(v) return t(v)