(
self,
*,
mgr_host: str,
cephx_name: str,
cephx_secret: str,
ca_path: str,
api_ssl_crt: str,
api_ssl_key: str,
mgr_agent_port: str,
config: Optional[Config] = None,
config_path: Optional[str] = None,
reporter_scheme: str = "https",
reporter_endpoint: str = "/node-proxy/data",
)
| 18 | |
| 19 | class NodeProxyManager: |
| 20 | def __init__( |
| 21 | self, |
| 22 | *, |
| 23 | mgr_host: str, |
| 24 | cephx_name: str, |
| 25 | cephx_secret: str, |
| 26 | ca_path: str, |
| 27 | api_ssl_crt: str, |
| 28 | api_ssl_key: str, |
| 29 | mgr_agent_port: str, |
| 30 | config: Optional[Config] = None, |
| 31 | config_path: Optional[str] = None, |
| 32 | reporter_scheme: str = "https", |
| 33 | reporter_endpoint: str = "/node-proxy/data", |
| 34 | ) -> None: |
| 35 | self.exc: Optional[Exception] = None |
| 36 | self.log = get_logger(__name__) |
| 37 | self.mgr_host = mgr_host |
| 38 | self.cephx_name = cephx_name |
| 39 | self.cephx_secret = cephx_secret |
| 40 | self.ca_path = ca_path |
| 41 | self.api_ssl_crt = api_ssl_crt |
| 42 | self.api_ssl_key = api_ssl_key |
| 43 | self.mgr_agent_port = str(mgr_agent_port) |
| 44 | self.stop: bool = False |
| 45 | self.ssl_ctx = ssl.create_default_context() |
| 46 | self.ssl_ctx.check_hostname = True |
| 47 | self.ssl_ctx.verify_mode = ssl.CERT_REQUIRED |
| 48 | self.ssl_ctx.load_verify_locations(self.ca_path) |
| 49 | self.reporter_scheme = reporter_scheme |
| 50 | self.reporter_endpoint = reporter_endpoint |
| 51 | self.cephx = {"cephx": {"name": self.cephx_name, "secret": self.cephx_secret}} |
| 52 | if config is not None: |
| 53 | self.config = config |
| 54 | else: |
| 55 | path = ( |
| 56 | config_path |
| 57 | or os.environ.get("NODE_PROXY_CONFIG") |
| 58 | or "/etc/ceph/node-proxy.yml" |
| 59 | ) |
| 60 | self.config = Config(path, defaults=DEFAULTS) |
| 61 | self.username: str = "" |
| 62 | self.password: str = "" |
| 63 | self._ca_temp_file: Optional[_TemporaryFileWrapper[Any]] = None |
| 64 | |
| 65 | def run(self) -> None: |
| 66 | self.init() |
nothing calls this directly
no test coverage detected