Skip to content

Commit

Permalink
reverse logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Sep 6, 2024
1 parent ec7766c commit 0c4c9e8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cubi_tk/sodar/lz_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ def setup_argparse(cls, parser: argparse.ArgumentParser) -> None:
help="Format string for printing, e.g. %%(uuid)s",
)

status = ["ACTIVE", "FAILED", "VALIDATING"]
parser.add_argument(
"--filter-status",
dest="filter_status",
default=set(),
default=set(status),
action="append",
choices=["ACTIVE", "FAILED", "VALIDATING"],
help="Filter landing zone by status",
choices=status,
help="Filter landing zone by status. Defaults to listing all.",
)

parser.add_argument("project_uuid", help="UUID of project to create the landing zone in.")
Expand Down Expand Up @@ -110,7 +111,7 @@ def execute(self) -> typing.Optional[int]:
key=lambda lz: lz.date_modified,
)
for lz in existing_lzs:
if lz.status in self.args.filter_status:
if lz.status not in self.args.filter_status:
continue
values = cattr.unstructure(lz)
if self.args.format_string:
Expand Down

0 comments on commit 0c4c9e8

Please sign in to comment.