Skip to content

Commit

Permalink
refactor(slurm_ops): pass _OpsManager rather than Path object to cons…
Browse files Browse the repository at this point in the history
…tructor

Signed-off-by: Jason C. Nucciarone <[email protected]>
  • Loading branch information
NucciTheBoss committed Oct 1, 2024
1 parent 438276c commit e4c7dba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/charms/hpc_libs/v0/slurm_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ def _env_manager_for(self, type: _ServiceType) -> _EnvManager:
class _JWTKeyManager:
"""Control the jwt signing key used by Slurm."""

def __init__(self, keyfile: Path) -> None:
self._keyfile = keyfile
def __init__(self, ops_manager: _OpsManager) -> None:
self._keyfile = ops_manager.var_lib_path / "slurm.state/jwt_hs256.key"

def get(self) -> str:
"""Get the current jwt key."""
Expand Down Expand Up @@ -693,7 +693,7 @@ def __init__(self, service: _ServiceType, snap: bool = False) -> None:
self._ops_manager = _SnapManager() if snap else _AptManager(service)
self.service = self._ops_manager.service_manager_for(service)
self.munge = _MungeManager(self._ops_manager)
self.jwt = _JWTKeyManager(self._ops_manager.var_lib_path / "slurm.data/jwt_hs256.key")
self.jwt = _JWTKeyManager(self._ops_manager)
self.exporter = _PrometheusExporterManager(self._ops_manager)
self.install = self._ops_manager.install
self.version = self._ops_manager.version
Expand Down

0 comments on commit e4c7dba

Please sign in to comment.