Skip to content

Commit f26b106

Browse files
authored
Normalize data dir before rename on initialize failure (patroni#3374)
Close patroni#3371
1 parent 0567d36 commit f26b106

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

patroni/postgresql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ def move_data_directory(self) -> None:
13571357
os.unlink(source)
13581358
os.symlink(new_name, source)
13591359

1360-
new_name = '{0}.{1}'.format(self._data_dir, postfix)
1360+
new_name = '{0}.{1}'.format(self._data_dir.rstrip(os.sep), postfix)
13611361
logger.info('renaming data directory to %s', new_name)
13621362
if os.path.exists(new_name):
13631363
shutil.rmtree(new_name)

0 commit comments

Comments
 (0)