Skip to content
Snippets Groups Projects

:hammer: rewrote expanding to allow blacklisting

Merged Vincent Hatakeyama requested to merge topic/default/blacklisting into branch/default
+ 9
5
@@ -3,6 +3,7 @@
import configparser
import logging
import os
import re
import sys
from collections import defaultdict
from glob import glob
@@ -60,6 +61,13 @@
_logger.error("Expansion without path for %s", name)
raise Exception("Expansion without path for %s" % name)
else:
if not blacklist or value["path"] not in glob(blacklist):
if blacklist and re.match(blacklist, value["path"]):
_logger.info(
"Ignoring directory '%s' due to blacklisting",
value["path"],
)
else:
if path:
value["path"] = os.path.join(path, value["path"])
# read expanded configurations
self._expanded_configuration[name] = Configuration(**value)
@@ -64,9 +72,5 @@
# read expanded configurations
self._expanded_configuration[name] = Configuration(**value)
else:
_logger.info(
"Ignoring %s due to blacklisting", value["path"]
)
def set_from_glob_values(
base: Optional[str], glob_values: List[str]
Loading