]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cepahdm: adding a message when certificates check is OK 61544/head
authorRedouane Kachach <rkachach@ibm.com>
Thu, 6 Mar 2025 14:04:54 +0000 (15:04 +0100)
committerRedouane Kachach <rkachach@ibm.com>
Tue, 11 Mar 2025 09:34:25 +0000 (10:34 +0100)
Signed-off-by: Redouane Kachach <rkachach@ibm.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/module.py

index d3b027ce1fd50f53e4ba7bd61f6da989bff9057c..2bbc58932fc2de8c778dbcf42fdf137722de4b31 100644 (file)
@@ -3216,9 +3216,12 @@ Then run the following:
     def cert_store_cert_check(self) -> List[str]:
         report = []
         _, certs_with_issues = self.cert_mgr.check_services_certificates(fix_issues=False)
-        for cert_info in certs_with_issues:
-            if not cert_info.is_operationally_valid():
-                report.append(cert_info.get_status_description())
+        if certs_with_issues:
+            for cert_info in certs_with_issues:
+                if not cert_info.is_operationally_valid():
+                    report.append(cert_info.get_status_description())
+        else:
+            report.append('All certificates are valid. No issues detected.')
         return report
 
     @handle_orch_error
index d362bbcabb585663d67b6a535984176bdd211b1c..d099a4641021a941ece173d4bd4f0d371b29f48f 100644 (file)
@@ -1251,6 +1251,9 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
         force: Optional[bool] = False,
         inbuf: Optional[str] = None
     ) -> HandleCommandResult:
+        """
+        Sets the cert-key pair from -i <pem-file>, which must be a valid PEM file containing both the certificate and the private key.
+        """
         if inbuf:
             cert_content, key_content = parse_combined_pem_file(inbuf)
             if not cert_content or not key_content:
@@ -1282,6 +1285,9 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
         hostname: Optional[str] = None,
         inbuf: Optional[str] = None
     ) -> HandleCommandResult:
+        """
+        Sets the cert from the --cert argument or from -i <cert-file>.
+        """
         cert_content = cert or inbuf
         if not cert_content:
             raise OrchestratorError('This command requires passing a certificate using --cert parameter or "-i <filepath>" option')
@@ -1305,6 +1311,9 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
         hostname: Optional[str] = None,
         inbuf: Optional[str] = None
     ) -> HandleCommandResult:
+        """
+        Sets the key from the --key argument or from -i <key-file>.
+        """
         key_content = key or inbuf
         if not key_content:
             raise OrchestratorError('This command requires passing a key using --key parameter or "-i <filepath>" option')