Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure refresh and refresh_db both work in aptpkg #55643

Merged
merged 3 commits into from
Dec 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions salt/modules/aptpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,13 @@ def mod_repo(repo, saltenv='base', **kwargs):

.. versionadded:: 2015.8.9

refresh : True
Enable or disable (True or False) refreshing of the apt package
database. The previous ``refresh_db`` argument was deprecated in
favor of ``refresh```. The ``refresh_db`` argument will still
continue to work to ensure backwards compatibility, but please
change to using the preferred ``refresh``.

.. note::
Due to the way keys are stored for APT, there is a known issue where
the key won't be updated unless another change is made at the same
Expand All @@ -2067,12 +2074,6 @@ def mod_repo(repo, saltenv='base', **kwargs):
salt '*' pkg.mod_repo 'myrepo definition' comps=main,universe
'''
if 'refresh_db' in kwargs:
salt.utils.versions.warn_until(
'Neon',
'The \'refresh_db\' argument to \'pkg.mod_repo\' has been '
'renamed to \'refresh\'. Support for using \'refresh_db\' will be '
'removed in the Neon release of Salt.'
)
refresh = kwargs['refresh_db']
else:
refresh = kwargs.get('refresh', True)
Expand Down
13 changes: 4 additions & 9 deletions salt/states/pkgrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
import salt.utils.files
import salt.utils.pkg.deb
import salt.utils.pkg.rpm
import salt.utils.versions

# Import 3rd-party libs
from salt.ext import six
Expand Down Expand Up @@ -299,21 +298,17 @@ def managed(name, ppa=None, **kwargs):
on debian based systems.

refresh_db : True
.. deprecated:: 2018.3.0
Use ``refresh`` instead.
This argument has been deprecated. Please use ``refresh`` instead.
The ``refresh_db`` argument will continue to work to ensure backwards
compatibility, but we recommend using the preferred ``refresh``
argument instead.

require_in
Set this to a list of pkg.installed or pkg.latest to trigger the
running of apt-get update prior to attempting to install these
packages. Setting a require in the pkg state will not work for this.
'''
if 'refresh_db' in kwargs:
salt.utils.versions.warn_until(
'Neon',
'The \'refresh_db\' argument to \'pkg.mod_repo\' has been '
'renamed to \'refresh\'. Support for using \'refresh_db\' will be '
'removed in the Neon release of Salt.'
)
kwargs['refresh'] = kwargs.pop('refresh_db')

ret = {'name': name,
Expand Down