From 3e99b6f6530935d2a02bf1c07efd60d038a362e2 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 1 Nov 2018 15:14:26 -0400 Subject: [PATCH 1/2] Handle deprecation of test.rand_str for Neon This function was marked for removal in the Neon release in favor of using the more complete random_hash function. Conflicts: - doc/topics/releases/neon.rst - salt/utils/hashutils.py --- doc/topics/releases/neon.rst | 6 ++++++ salt/modules/test.py | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/doc/topics/releases/neon.rst b/doc/topics/releases/neon.rst index 0d19bf0d2888..be7268a56a0a 100644 --- a/doc/topics/releases/neon.rst +++ b/doc/topics/releases/neon.rst @@ -147,6 +147,12 @@ Module Deprecations - :py:func:`dockermod.load ` - :py:func:`dockermod.tag ` +- The :py:mod:`test ` execution module has been changed as follows: + + - Support for the :py:func:`test.rand_str ` has been + removed. Please use the :py:func:`test.random_hash ` + function instead. + State Deprecations ------------------ diff --git a/salt/modules/test.py b/salt/modules/test.py index 09a3194043fb..61c794058af7 100644 --- a/salt/modules/test.py +++ b/salt/modules/test.py @@ -18,7 +18,6 @@ import salt.utils.functools import salt.utils.hashutils import salt.utils.platform -import salt.utils.versions import salt.version import salt.loader from salt.ext import six @@ -496,14 +495,6 @@ def opts_pkg(): return ret -def rand_str(size=9999999999, hash_type=None): - salt.utils.versions.warn_until( - 'Neon', - 'test.rand_str has been renamed to test.random_hash' - ) - return random_hash(size=size, hash_type=hash_type) - - def random_hash(size=9999999999, hash_type=None): ''' .. versionadded:: 2015.5.2 From c8c7bf9ec246fd16439b81823cc6e9bf26371cc1 Mon Sep 17 00:00:00 2001 From: ch3ll Date: Fri, 20 Dec 2019 14:58:21 -0500 Subject: [PATCH 2/2] keep rand_str to ensure backwards compatibility --- doc/topics/releases/neon.rst | 6 ------ salt/modules/test.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/topics/releases/neon.rst b/doc/topics/releases/neon.rst index be7268a56a0a..0d19bf0d2888 100644 --- a/doc/topics/releases/neon.rst +++ b/doc/topics/releases/neon.rst @@ -147,12 +147,6 @@ Module Deprecations - :py:func:`dockermod.load ` - :py:func:`dockermod.tag ` -- The :py:mod:`test ` execution module has been changed as follows: - - - Support for the :py:func:`test.rand_str ` has been - removed. Please use the :py:func:`test.random_hash ` - function instead. - State Deprecations ------------------ diff --git a/salt/modules/test.py b/salt/modules/test.py index 61c794058af7..a2f48ff07e04 100644 --- a/salt/modules/test.py +++ b/salt/modules/test.py @@ -495,6 +495,16 @@ def opts_pkg(): return ret +def rand_str(size=9999999999, hash_type=None): + ''' + This function has been renamed to + random_hash. This function will stay to + ensure backwards compatibility, but please + switch to using the prefered name random_hash. + ''' + return random_hash(size=size, hash_type=hash_type) + + def random_hash(size=9999999999, hash_type=None): ''' .. versionadded:: 2015.5.2