Skip to content

Commit

Permalink
use relativepath for suffix identifcation
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Sep 26, 2024
1 parent 3372b78 commit 0a2317e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@

def list_not_existing_storage_dirs(client: Bfabric, root_dir: Path, technology_id: int | list[int]) -> None:
"""Lists not existing storage directories for a given technology id."""
results = client.read(endpoint="container", obj={"technologyid": technology_id}, return_id_only=True)
results = client.read(
endpoint="container",
obj={"technologyid": technology_id},
return_id_only=True,
max_results=500,
)
container_ids = sorted({x["id"] for x in results})

for container_id in container_ids:
if not (root_dir / f"p{container_id}").is_dir():
print(container_id)


def main() -> None:
"""Parses CLI arguments and calls `list_not_existing_storage_dirs`."""
"""Calls `list_not_existing_storage_dirs`."""
client = Bfabric.from_config()
root_dir = Path("/srv/www/htdocs/")
list_not_existing_storage_dirs(client=client, root_dir=root_dir, technology_id=[2, 4])
Expand Down

1 comment on commit 0a2317e

@leoschwarz
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong commit message

Please sign in to comment.