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