deprecate FileLock (#75032)
Co-authored-by: flowerysong <junk+github@flowerysong.com>
This commit is contained in:
parent
ce17498ec5
commit
e8ae7211da
2 changed files with 5 additions and 0 deletions
2
changelogs/fragments/filelock_bye.yml
Normal file
2
changelogs/fragments/filelock_bye.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
deprecated_features:
|
||||
- module_utils' FileLock is scheduled to be removed, it is not used due to its unreliable nature.
|
|
@ -19,6 +19,7 @@ import sys
|
|||
from contextlib import contextmanager
|
||||
from ansible.module_utils._text import to_bytes, to_native, to_text
|
||||
from ansible.module_utils.six import b, binary_type
|
||||
from ansible.module_utils.common.warnings import deprecate
|
||||
|
||||
try:
|
||||
import selinux
|
||||
|
@ -122,6 +123,8 @@ class FileLock:
|
|||
unwanted and/or unexpected behaviour
|
||||
'''
|
||||
def __init__(self):
|
||||
deprecate("FileLock is not reliable and has never been used in core for that reason. There is no current alternative that works across POSIX targets",
|
||||
version='2.16')
|
||||
self.lockfd = None
|
||||
|
||||
@contextmanager
|
||||
|
|
Loading…
Add table
Reference in a new issue