Skip to content

Commit

Permalink
Fix InvalidPackage handling
Browse files Browse the repository at this point in the history
  • Loading branch information
WangGithubUser committed Aug 22, 2023
1 parent 66edd67 commit bb2e017
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 10 additions & 2 deletions client/backend_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions client/configuration/search_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bb2e017

Please sign in to comment.