mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Remove deprecated code (#34828)
* Remove compat code for to_unicode, to_str and to_bytes Code was marked as deprecated and to be removed after 2.4 * Remove is_encrypted and is_encrypted_file Code was marked as deprecated after 2.4 release.
This commit is contained in:
parent
ec80f8ad80
commit
060001b08d
3 changed files with 2 additions and 58 deletions
|
@ -19,41 +19,10 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from ansible.module_utils._text import to_bytes as _to_bytes, to_text, to_native
|
||||
|
||||
try:
|
||||
from __main__ import display
|
||||
except ImportError:
|
||||
from ansible.utils.display import Display
|
||||
display = Display()
|
||||
from ansible.module_utils._text import to_text
|
||||
|
||||
|
||||
__all__ = ('to_bytes', 'to_unicode', 'to_str', 'unicode_wrap')
|
||||
|
||||
|
||||
# Backwards compat
|
||||
|
||||
def to_bytes(*args, **kwargs):
|
||||
display.deprecated(u'ansible.utils.unicode.to_bytes is deprecated. Use ansible.module_utils._text.to_bytes instead', version=u'2.4')
|
||||
if 'errors' not in kwargs:
|
||||
kwargs['errors'] = 'replace'
|
||||
return _to_bytes(*args, **kwargs)
|
||||
|
||||
|
||||
def to_unicode(*args, **kwargs):
|
||||
display.deprecated(u'ansible.utils.unicode.to_unicode is deprecated. Use ansible.module_utils._text.to_text instead', version=u'2.4')
|
||||
if 'errors' not in kwargs:
|
||||
kwargs['errors'] = 'replace'
|
||||
return to_text(*args, **kwargs)
|
||||
|
||||
|
||||
def to_str(*args, **kwargs):
|
||||
display.deprecated(u'ansible.utils.unicode.to_str is deprecated. Use ansible.module_utils._text.to_native instead', version=u'2.4')
|
||||
if 'errors' not in kwargs:
|
||||
kwargs['errors'] = 'replace'
|
||||
return to_native(*args, **kwargs)
|
||||
|
||||
# End Backwards compat
|
||||
__all__ = ('unicode_wrap')
|
||||
|
||||
|
||||
def unicode_wrap(func, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue