From 85812d977b8e5eb8c1643d2f77cd163d0c15b17c Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Fri, 28 Jun 2024 07:25:12 -0700 Subject: [PATCH] Create tdb directories if needed (#13947) These directories used to be created on initialization of tdb plugin. --- src/middlewared/middlewared/utils/tdb.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/middlewared/middlewared/utils/tdb.py b/src/middlewared/middlewared/utils/tdb.py index ced61a31b94be..451d0a6a18bc6 100644 --- a/src/middlewared/middlewared/utils/tdb.py +++ b/src/middlewared/middlewared/utils/tdb.py @@ -304,6 +304,9 @@ def __init__( ) self.full_path = name case _: + if not os.path.exists(self.path_type.value): + os.makedirs(self.path_type.value, mode=0o700, exist_ok=True) + self.full_path = f'{self.path_type.value}/{name}.tdb' self.hdl = tdb.Tdb(self.full_path, 0, tdb_flags, open_flags, open_mode)