22
33import json
44import rados
5- from typing import Any , Dict , List
5+ from typing import Any , Dict
66from .exception import ModuleException
77
88
@@ -19,7 +19,7 @@ def __init__(self, config: Dict[str, Any]):
1919 def __getattr__ (self , name : str ) -> Any :
2020 return getattr (self .__ceph , name )
2121
22- def _json_command (self , handler : Any , * args : Any ) -> Dict [ str , Any ] | List [ Any ] :
22+ def _json_command (self , handler : Any , * args : Any ) -> Any :
2323 result = handler (* args )
2424 if result [0 ] != 0 :
2525 raise ModuleException (f"Ceph did return an error: { result } " )
@@ -53,19 +53,17 @@ def get_osd_pool_configurations_from_osd_dump(
5353
5454 return osd_pools
5555
56- def mon_command (self , command : str , ** kwargs : Any ) -> Dict [ str , Any ] | List [ Any ] :
56+ def mon_command (self , command : str , ** kwargs : Any ) -> Any :
5757 cmd = {"prefix" : command , "format" : "json" }
5858 cmd .update (** kwargs )
5959 return self ._json_command (self .__ceph .mon_command , json .dumps (cmd ), b"" )
6060
61- def mgr_command (self , command : str , ** kwargs : Any ) -> Dict [ str , Any ] | List [ Any ] :
61+ def mgr_command (self , command : str , ** kwargs : Any ) -> Any :
6262 cmd = {"prefix" : command , "format" : "json" }
6363 cmd .update (** kwargs )
6464 return self ._json_command (self .__ceph .mgr_command , json .dumps (cmd ), b"" )
6565
66- def osd_command (
67- self , osd_id : int , command : str , ** kwargs : Any
68- ) -> Dict [str , Any ] | List [Any ]:
66+ def osd_command (self , osd_id : int , command : str , ** kwargs : Any ) -> Any :
6967 cmd = {"prefix" : command , "format" : "json" }
7068 cmd .update (** kwargs )
7169 return self ._json_command (self .__ceph .osd_command , osd_id , json .dumps (cmd ), b"" )
0 commit comments