mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmdbusd: its fine if dir already exists
With previous patch, we now need to handle the case when dir already exists.
This commit is contained in:
parent
7c4be946cb
commit
1bb03cff66
@ -778,7 +778,7 @@ class LockFile(object):
|
|||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
try:
|
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)
|
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
|
# Get and set the close on exec and lock the file
|
||||||
|
Loading…
Reference in New Issue
Block a user