Skip to content

Commit

Permalink
Pythonic error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Jan 31, 2025
1 parent 02aa0e1 commit 1afd914
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/manifests_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ def filter_containers(self, containers: list) -> Generator:
yield container


def update_storage_params(ceph_type: str, config: Dict[str, Any], params: Dict[str, str]) -> None:
"""Adjust parameters for storage class."""
cfg_name = f"{ceph_type}-storage-class-parameters"
if not (adjustments := config.get(cfg_name)):
log.info(f"No adjustments for {ceph_type} storage-class parameters")
return

class CephToleration(Toleration):
@classmethod
def _from_string(cls, toleration_str: str) -> "CephToleration":
Expand Down Expand Up @@ -138,6 +131,7 @@ def from_space_separated(cls, tolerations: str) -> List["CephToleration"]:
except ValueError as e:
raise ValueError(f"Invalid tolerations: {e}") from e


def update_storage_params(ceph_type: str, config: Dict[str, Any], params: Dict[str, str]) -> None:
"""Adjust parameters for storage class."""
cfg_name = f"{ceph_type}-storage-class-parameters"
Expand Down
1 change: 1 addition & 0 deletions src/manifests_cephfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def __call__(self) -> List[AnyResource]:

class ProvisionerAdjustments(Patch):
"""Update Cephfs provisioner."""

PROVISIONER_NAME = "csi-cephfsplugin-provisioner"
PLUGIN_NAME = "csi-cephfsplugin"

Expand Down

0 comments on commit 1afd914

Please # to comment.