Skip to content

Commit

Permalink
avoid the extra request
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Aug 12, 2024
1 parent 32ea5a4 commit 317ae7e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bfabric/entities/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ def __init__(self, data_dict: dict[str, Any], client: Bfabric | None) -> None:
@cached_property
def scp_prefix_no_path(self) -> str:
"""SCP prefix without storage base path included."""
result = self._client.read("access", {"storageid": self.id, "type": "scp"})
if len(result) != 1:
raise ValueError(f"Expected exactly 1 SCP access for storage {self.id}, actual: {len(result)}")
return f"{result[0]['host']}:"
return f"{self.data_dict['host']}:"

@cached_property
def scp_prefix_full(self) -> str:
Expand Down

0 comments on commit 317ae7e

Please sign in to comment.