|
|
@ -19,9 +19,6 @@ from ansible.module_utils.six import string_types
|
|
|
|
from ansible.release import __version__
|
|
|
|
from ansible.release import __version__
|
|
|
|
from ansible.utils.fqcn import add_internal_fqcns
|
|
|
|
from ansible.utils.fqcn import add_internal_fqcns
|
|
|
|
|
|
|
|
|
|
|
|
# 4 versions above current
|
|
|
|
|
|
|
|
default_deprecated = to_text(float('.'.join(__version__.split('.')[0:2])) + 0.04)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _warning(msg):
|
|
|
|
def _warning(msg):
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
@ -33,7 +30,7 @@ def _warning(msg):
|
|
|
|
sys.stderr.write(' [WARNING] %s\n' % (msg))
|
|
|
|
sys.stderr.write(' [WARNING] %s\n' % (msg))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _deprecated(msg, version=default_deprecated):
|
|
|
|
def _deprecated(msg, version):
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
''' display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write '''
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from ansible.utils.display import Display
|
|
|
|
from ansible.utils.display import Display
|
|
|
@ -55,11 +52,11 @@ class _DeprecatedSequenceConstant(Sequence):
|
|
|
|
self._version = version
|
|
|
|
self._version = version
|
|
|
|
|
|
|
|
|
|
|
|
def __len__(self):
|
|
|
|
def __len__(self):
|
|
|
|
_deprecated(self._msg, version=self._version)
|
|
|
|
_deprecated(self._msg, self._version)
|
|
|
|
return len(self._value)
|
|
|
|
return len(self._value)
|
|
|
|
|
|
|
|
|
|
|
|
def __getitem__(self, y):
|
|
|
|
def __getitem__(self, y):
|
|
|
|
_deprecated(self._msg, version=self._version)
|
|
|
|
_deprecated(self._msg, self._version)
|
|
|
|
return self._value[y]
|
|
|
|
return self._value[y]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|