From 1bb03cff661da1c0adbf8a1edba4c6da27807cf8 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 28 Apr 2024 23:32:00 +0200 Subject: [PATCH] lvmdbusd: its fine if dir already exists With previous patch, we now need to handle the case when dir already exists. --- daemons/lvmdbusd/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py index 830648659..3b1ac801f 100644 --- a/daemons/lvmdbusd/utils.py +++ b/daemons/lvmdbusd/utils.py @@ -778,7 +778,7 @@ class LockFile(object): def __enter__(self): try: - os.makedirs(os.path.dirname(self.lock_file)) + os.makedirs(os.path.dirname(self.lock_file), exist_ok=True) self.fd = os.open(self.lock_file, os.O_CREAT | os.O_RDWR, stat.S_IRUSR | stat.S_IWUSR) # Get and set the close on exec and lock the file