Skip to content

Commit

Permalink
Issue 4843 - Fix dscreate create-template issue (#5950)
Browse files Browse the repository at this point in the history
Regression with dscreate from-instance before creating first instance:
the target directory does not exists and a warning is inserted in the template file
which is then broken.

Fix is pretty trivial:
Select an existing directory to compute the file system free space.

Issue #5943

Reviewed by: @droideck (Thanks !)
  • Loading branch information
progier389 authored Oct 16, 2023
1 parent f52d10a commit 91c4f62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib389/lib389/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,11 @@ def get_default_mdb_max_size(paths):
# Make sure that there is enough available disk space
# otherwise decrease the value
dbdir = paths.db_dir
while '{' in dbdir:
# dbdir may not exists because:
# - paths instance name has not been expanded
# - dscreate has not yet created it.
# so let use the first existing parent in that case.
while not os.path.exists(dbdir):
dbdir = os.path.dirname(dbdir)
try:
statvfs = os.statvfs(dbdir)
Expand Down

0 comments on commit 91c4f62

Please sign in to comment.