Skip to content

Commit

Permalink
simplify Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Aug 12, 2024
1 parent 07c6668 commit 6568ff7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bfabric/entities/storage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from functools import cached_property
from typing import Any, TYPE_CHECKING
from pathlib import Path
from typing import Any

from bfabric import Bfabric
from bfabric.entities.core.entity import Entity
Expand All @@ -13,12 +14,9 @@ class Storage(Entity):
def __init__(self, data_dict: dict[str, Any], client: Bfabric | None) -> None:
super().__init__(data_dict=data_dict, client=client)

@cached_property
def scp_prefix_no_path(self) -> str:
"""SCP prefix without storage base path included."""
return f"{self.data_dict['host']}:"
base_path = property(lambda self: Path(self.data_dict["basepath"]))

@cached_property
def scp_prefix_full(self) -> str:
def scp_prefix(self) -> str:
"""SCP prefix with storage base path included."""
return f"{self.scp_prefix_no_path}{self.data_dict['basepath']}"
return f"{self.data_dict['host']}:{self.data_dict['basepath']}"

0 comments on commit 6568ff7

Please sign in to comment.