Skip to content

Commit 6677d06

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Provide improved diagnostics on failed CinderX initialization
Summary: When we fail to initialize `cinderx` it's usually due to a missing symbol - but it's hard to know what that is right now. This tries to import `_cinderx` and then prints the exception so it's more actionable. Reviewed By: yoney Differential Revision: D92569204 fbshipit-source-id: d6f8189f3c59be09f139bdfcaee3f248803c1e5d
1 parent 58b83fd commit 6677d06

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cinderx/PythonLib/test_cinderx/test_oss_quick.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ class CinderXOSSTest(unittest.TestCase):
1010
def test_import(self) -> None:
1111
import cinderx # noqa: F401
1212

13+
if not cinderx.is_initialized():
14+
try:
15+
import _cinderx
16+
except Exception as e:
17+
print(f"Failed to import cinder: {e}")
18+
1319
self.assertTrue(cinderx.is_initialized())
1420

1521

0 commit comments

Comments
 (0)