Skip to content

Commit

Permalink
Add support to call "librados.osd_command()" as well
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Wolf <[email protected]>
  • Loading branch information
NotTheEvilOne committed Sep 3, 2024
1 parent 00667e7 commit e68cf28
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rookify/modules/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ def mon_command(self, command: str, **kwargs: str) -> Dict[str, Any] | List[Any]
assert isinstance(data, dict) or isinstance(data, list)

return data

def mon_command(self, command: str, **kwargs: str) -> Dict[str, Any] | List[Any]:
cmd = {"prefix": command, "format": "json"}
cmd.update(**kwargs)
return self._json_command(self.__ceph.mon_command, json.dumps(cmd), b"") # type: ignore

def osd_command(
self, osd_id: int, command: str, **kwargs: str
) -> Dict[str, Any] | List[Any]:
cmd = {"prefix": command, "format": "json"}
cmd.update(**kwargs)
return self._json_command(self.__ceph.osd_command, osd_id, json.dumps(cmd), b"") # type: ignore

0 comments on commit e68cf28

Please sign in to comment.