Skip to content

Commit

Permalink
Exclude non-directories from flow cell lists (#2971)(patch)
Browse files Browse the repository at this point in the history
The flow cell directory in production holds some files that are not directories. The automation tries to create a sample sheet for those files interpreted as directories, which adds unnecessary errors to the logs.


### Fixed

- Checks that a flow cell directory is indeed a directory before trying to create a sample sheet for it
  • Loading branch information
diitaz93 authored Feb 22, 2024
1 parent 6ad8fb1 commit 4772c78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cg/apps/demultiplex/sample_sheet/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
delete_file_from_housekeeper,
)
from cg.models.flow_cell.flow_cell import FlowCellDirectoryData
from cg.utils.files import link_or_overwrite_file
from cg.utils.files import get_directories_in_path, link_or_overwrite_file

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -186,7 +186,7 @@ def get_or_create_sample_sheet(self, flow_cell_name: str, bcl_converter: str | N

def get_or_create_all_sample_sheets(self):
"""Ensure that a valid sample sheet is present in all flow cell directories."""
for flow_cell_dir in self.flow_cell_runs_dir.iterdir():
for flow_cell_dir in get_directories_in_path(self.flow_cell_runs_dir):
try:
self.get_or_create_sample_sheet(
flow_cell_name=flow_cell_dir.name, bcl_converter=None
Expand Down

0 comments on commit 4772c78

Please sign in to comment.