diff --git a/kheops/controllers.py b/kheops/controllers.py index 834ad00..99c1d21 100644 --- a/kheops/controllers.py +++ b/kheops/controllers.py @@ -266,7 +266,7 @@ class QueryProcessor: lookup["path"] = new_path new_lookups3.append(lookup) else: - log.info("Ignore because of missing scope vars: '%s'", path) + log.warning("Ignore lookup item because of missing scope vars: '%s'", path) return new_lookups3 diff --git a/kheops/plugin/backend/file.py b/kheops/plugin/backend/file.py index f9b86c4..c251a98 100644 --- a/kheops/plugin/backend/file.py +++ b/kheops/plugin/backend/file.py @@ -32,7 +32,7 @@ class Plugin(BackendPlugin): "description": "This backend will look for data inside a file hierarchy.", "type": "object", "properties": { - "format": { + "extensions": { "title": "File formats", "description": """ This object describe which parser is assigned to which extension. @@ -124,19 +124,24 @@ class Plugin(BackendPlugin): raw_data = None status = "not_found" - for ext, parser in self.extensions.items(): + extensions = self.config.get("extensions", self.extensions) + for ext, parser in extensions.items(): new_path = os.path.join(self.top_path, path + ext) - log.debug("Looking into %s", new_path) if os.path.isfile(new_path): status = "found" try: + log.info("Found file: %s", new_path) raw_data = anyconfig.load(new_path, ac_parser=parser) except AnyConfigBaseError as err: status = "broken" raw_data = None log.warning("Could not parse file %s: %s", new_path, err) + + # Stop the loop extension if we found a result. break + log.debug("Skip absent file: %s", new_path) + ret = BackendCandidate( path=new_path, status=status, diff --git a/kheops/plugin/common.py b/kheops/plugin/common.py index a1ba393..c0105a1 100644 --- a/kheops/plugin/common.py +++ b/kheops/plugin/common.py @@ -35,7 +35,8 @@ class KheopsPlugin: self.config = self.ns.config["config"].get(config_key, {}) self.config_key = config_key - log.debug("Looking for plugin configuration in config with key '%s', got: %s", config_key, self.config) + #if self.config: + # log.debug("Load plugin configuration in config with key '%s', got: %s", config_key, self.config) self._init() def _init(self): diff --git a/kheops/plugin/scope/loop.py b/kheops/plugin/scope/loop.py index 2c1153f..2ac3092 100644 --- a/kheops/plugin/scope/loop.py +++ b/kheops/plugin/scope/loop.py @@ -12,7 +12,7 @@ log = logging.getLogger(__name__) class Plugin(ScopePlugin, ScopeExtLoop): """Hierarchy plugin""" - _plugin_name = "hier" + plugin_name = "hier" _schema_props_new = { "hier": { "default": None,