Fix: Minor bugs and log messages
This commit is contained in:
parent
07ecaa8085
commit
1f38ce7dba
@ -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
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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):
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user