diff --git a/client/backend_arguments.py b/client/backend_arguments.py index c5a3703155e..29da1f181a4 100644 --- a/client/backend_arguments.py +++ b/client/backend_arguments.py @@ -34,6 +34,8 @@ from .configuration import search_path +from .configuration.exceptions import InvalidConfiguration + LOG: logging.Logger = logging.getLogger(__name__) SERVER_ARTIFACT_ROOT_NAME: str = "link_trees" @@ -69,7 +71,10 @@ def serialize(self) -> Dict[str, object]: } def get_checked_directory_allowlist(self) -> Set[str]: - return {element.path() for element in self.elements} + try: + return {element.path() for element in self.elements} + except InvalidConfiguration: + return set() def cleanup(self) -> None: pass @@ -98,7 +103,10 @@ def serialize(self) -> Dict[str, object]: } def get_checked_directory_allowlist(self) -> Set[str]: - return {element.path() for element in self.elements} + try: + return {element.path() for element in self.elements} + except InvalidConfiguration: + return set() def cleanup(self) -> None: pass diff --git a/client/configuration/search_path.py b/client/configuration/search_path.py index f11497d8b2c..c28e1a6d985 100644 --- a/client/configuration/search_path.py +++ b/client/configuration/search_path.py @@ -270,10 +270,13 @@ def process_raw_elements( elements: List[Element] = [] def add_if_exists(element: Element) -> bool: - if os.path.exists(element.path()): - elements.append(element) - return True - return False + try: + if os.path.exists(element.path()): + elements.append(element) + return True + return False + except exceptions.InvalidConfiguration: + return False for raw_element in raw_elements: expanded_raw_elements = raw_element.expand_glob()