Skip to content

Commit

Permalink
feat: add --filter-status option for controlling which landing zones …
Browse files Browse the repository at this point in the history
…are listed
  • Loading branch information
tedil committed Sep 6, 2024
1 parent 8669118 commit 30a62af
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cubi_tk/sodar/lz_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ def setup_argparse(cls, parser: argparse.ArgumentParser) -> None:
help="Format string for printing, e.g. %%(uuid)s",
)

parser.add_argument(
"--filter-status",
dest="filter_status",
default=[],
action='append',
help="Filter landing zones by status, e.g. ACTIVE, FAILED",
)

parser.add_argument("project_uuid", help="UUID of project to create the landing zone in.")

@classmethod
Expand Down Expand Up @@ -101,7 +109,7 @@ def execute(self) -> typing.Optional[int]:
key=lambda lz: lz.date_modified,
)
for lz in existing_lzs:
if lz.status != "ACTIVE":
if lz.status in self.args.filter_status:
continue
values = cattr.unstructure(lz)
if self.args.format_string:
Expand Down

0 comments on commit 30a62af

Please sign in to comment.