force version on deprecation (#74338)
This commit is contained in:
parent
d8fa2b50d5
commit
85e7108d52
3 changed files with 6 additions and 7 deletions
2
changelogs/fragments/c_deprecatd.yml
Normal file
2
changelogs/fragments/c_deprecatd.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- constants, internal _deprecated function always requires version.
|
|
@ -120,6 +120,7 @@ class ConnectionProcess(object):
|
|||
|
||||
def run(self):
|
||||
try:
|
||||
log_messages = self.connection.get_option('persistent_log_messages')
|
||||
while not self.connection._conn_closed:
|
||||
signal.signal(signal.SIGALRM, self.connect_timeout)
|
||||
signal.signal(signal.SIGTERM, self.handler)
|
||||
|
@ -133,7 +134,6 @@ class ConnectionProcess(object):
|
|||
data = recv_data(s)
|
||||
if not data:
|
||||
break
|
||||
log_messages = self.connection.get_option('persistent_log_messages')
|
||||
|
||||
if log_messages:
|
||||
display.display("jsonrpc request: %s" % data, log_only=True)
|
||||
|
|
|
@ -19,9 +19,6 @@ from ansible.module_utils.six import string_types
|
|||
from ansible.release import __version__
|
||||
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):
|
||||
''' 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))
|
||||
|
||||
|
||||
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 '''
|
||||
try:
|
||||
from ansible.utils.display import Display
|
||||
|
@ -55,11 +52,11 @@ class _DeprecatedSequenceConstant(Sequence):
|
|||
self._version = version
|
||||
|
||||
def __len__(self):
|
||||
_deprecated(self._msg, version=self._version)
|
||||
_deprecated(self._msg, self._version)
|
||||
return len(self._value)
|
||||
|
||||
def __getitem__(self, y):
|
||||
_deprecated(self._msg, version=self._version)
|
||||
_deprecated(self._msg, self._version)
|
||||
return self._value[y]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue