Skip to content

Commit 10dcc00

Browse files
jamesbeedyclaude
andcommitted
fix: add missing dashboard Python deps + fix crypto NameError
Add python3-jmespath and python3-xmltodict to snap stage-packages — required by ceph-mgr-dashboard for OAuth2 SSO role mapping and RGW client respectively. Fix 0004 patch to properly remove the dead crypto.load_privatekey block in verify_tls_files() that crashes the dashboard with NameError after the Tentacle cryptotools refactor. The subsequent verify_tls() call already validates cert+key via get_crypto_caller() (ProcessCryptoCaller). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32f95fc commit 10dcc00

2 files changed

Lines changed: 32 additions & 21 deletions

File tree

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2-
From: Local Builder <local@example.com>
3-
Date: Fri, 29 May 2026 00:00:00 +0000
4-
Subject: [PATCH] mgr/dashboard: import OpenSSL crypto in verify_tls_files
5-
6-
Fix the dashboard TLS validation path in Ceph 20.2.0 packaging where
7-
verify_tls_files references crypto without importing it at function scope,
8-
which crashes the mgr dashboard module with:
9-
10-
NameError: name 'crypto' is not defined
2+
From: James Beedy <james@vantagecompute.ai>
3+
Date: Fri, 30 May 2026 00:00:00 +0000
4+
Subject: [PATCH] mgr: fix NameError in verify_tls_files after cryptotools
5+
refactor
116

7+
Fix by removing the standalone private-key validation block that used
8+
OpenSSL.crypto directly. The subsequent verify_tls() call already
9+
validates both cert and key via get_crypto_caller().
1210
---
13-
share/ceph/mgr/mgr_util.py | 1 +
14-
1 file changed, 1 insertion(+)
11+
share/ceph/mgr/mgr_util.py | 10 ++--------
12+
1 file changed, 2 insertions(+), 8 deletions(-)
1513

16-
diff --git a/share/ceph/mgr/mgr_util.py b/share/ceph/mgr/mgr_util.py
17-
index abcdef1..1234567 100644
18-
--- a/share/ceph/mgr/mgr_util.py
19-
+++ b/share/ceph/mgr/mgr_util.py
20-
@@-1,6 +1,7 @@
21-
if not os.path.isfile(pkey_fname):
14+
--- a/share/ceph/mgr/mgr_util.py 2026-05-30 01:12:33.198837423 +0000
15+
+++ b/share/ceph/mgr/mgr_util.py 2026-05-30 01:12:33.201837419 +0000
16+
@@ -709,18 +709,10 @@
17+
elif not os.path.isfile(pkey_fname):
2218
raise ServerConfigException('private key %s does not exist' % pkey_fname)
23-
24-
+ from OpenSSL import crypto, SSL
19+
20+
-
21+
- try:
22+
- with open(pkey_fname) as f:
23+
- pkey = crypto.load_privatekey(crypto.FILETYPE_PEM, f.read())
24+
- pkey.check()
25+
- except (ValueError, crypto.Error) as e:
26+
- raise ServerConfigException(
27+
- 'Invalid private key {}: {}'.format(pkey_fname, str(e)))
2528
try:
26-
with open(pkey_fname) as f:
27-
pkey = crypto.load_privatekey(crypto.FILETYPE_PEM, f.read())
29+
with open(pkey_fname) as key_file, open(cert_fname) as cert_file:
30+
verify_tls(cert_file.read(), key_file.read())
31+
- except (ServerConfigException) as e:
32+
+ except ServerConfigException as e:
33+
raise ServerConfigException(str(e))
34+
35+
36+
2837
--
2938
2.43.0

snap/snapcraft.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ parts:
287287
- libatomic1
288288
- python3-ceph-common # used by microceph-orch
289289
- python3-openssl # used by ceph-mgr-dashboard for SSL
290+
- python3-jmespath # used by dashboard OAuth2 SSO role mapping
291+
- python3-xmltodict # used by dashboard RGW client
290292

291293
organize:
292294
sbin/: bin/

0 commit comments

Comments
 (0)