Skip to content

Commit

Permalink
Create tdb directories if needed (#13947)
Browse files Browse the repository at this point in the history
These directories used to be created on initialization of tdb
plugin.
  • Loading branch information
anodos325 authored Jun 28, 2024
1 parent 2d2bafc commit 85812d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/middlewared/middlewared/utils/tdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 85812d9

Please sign in to comment.