From 79886a2c645d2ca5d00cfcc1885a64576b9d4fc6 Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 23 May 2022 01:45:04 +0200 Subject: [PATCH] small fixes --- src/treepuncher/__main__.py | 3 ++- src/treepuncher/treepuncher.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/treepuncher/__main__.py b/src/treepuncher/__main__.py index 1208dfc..adacddd 100644 --- a/src/treepuncher/__main__.py +++ b/src/treepuncher/__main__.py @@ -15,7 +15,8 @@ from dataclasses import dataclass, MISSING, fields 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 def main(): diff --git a/src/treepuncher/treepuncher.py b/src/treepuncher/treepuncher.py index 394064d..a479c03 100644 --- a/src/treepuncher/treepuncher.py +++ b/src/treepuncher/treepuncher.py @@ -59,7 +59,7 @@ class Treepuncher( v = kwargs.get(k) or self.cfg.get(k) or default if not v and required: 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 t(v)