Skip to content

Commit e5003a6

Browse files
committed
mgr/cepahdm: adding a message when certificates check is OK
Signed-off-by: Redouane Kachach <[email protected]>
1 parent ec2b341 commit e5003a6

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/pybind/mgr/cephadm/module.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,9 +3216,12 @@ def cert_store_reload(self) -> str:
32163216
def cert_store_cert_check(self) -> List[str]:
32173217
report = []
32183218
_, certs_with_issues = self.cert_mgr.check_services_certificates(fix_issues=False)
3219-
for cert_info in certs_with_issues:
3220-
if not cert_info.is_operationally_valid():
3221-
report.append(cert_info.get_status_description())
3219+
if certs_with_issues:
3220+
for cert_info in certs_with_issues:
3221+
if not cert_info.is_operationally_valid():
3222+
report.append(cert_info.get_status_description())
3223+
else:
3224+
report.append('All certificates are valid. No issues detected.')
32223225
return report
32233226

32243227
@handle_orch_error

src/pybind/mgr/orchestrator/module.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,9 @@ def _cert_store_cert_key_set(
12511251
force: Optional[bool] = False,
12521252
inbuf: Optional[str] = None
12531253
) -> HandleCommandResult:
1254+
"""
1255+
Sets the cert-key pair from -i <pem-file>, which must be a valid PEM file containing both the certificate and the private key.
1256+
"""
12541257
if inbuf:
12551258
cert_content, key_content = parse_combined_pem_file(inbuf)
12561259
if not cert_content or not key_content:
@@ -1282,6 +1285,9 @@ def _cert_store_set_cert(
12821285
hostname: Optional[str] = None,
12831286
inbuf: Optional[str] = None
12841287
) -> HandleCommandResult:
1288+
"""
1289+
Sets the cert from the --cert argument or from -i <cert-file>.
1290+
"""
12851291
cert_content = cert or inbuf
12861292
if not cert_content:
12871293
raise OrchestratorError('This command requires passing a certificate using --cert parameter or "-i <filepath>" option')
@@ -1305,6 +1311,9 @@ def _cert_store_set_key(
13051311
hostname: Optional[str] = None,
13061312
inbuf: Optional[str] = None
13071313
) -> HandleCommandResult:
1314+
"""
1315+
Sets the key from the --key argument or from -i <key-file>.
1316+
"""
13081317
key_content = key or inbuf
13091318
if not key_content:
13101319
raise OrchestratorError('This command requires passing a key using --key parameter or "-i <filepath>" option')

0 commit comments

Comments
 (0)