Skip to content

Commit

Permalink
Merge pull request #55643 from Ch3LL/issue_49418
Browse files Browse the repository at this point in the history
Ensure refresh and refresh_db both work in aptpkg
  • Loading branch information
dwoz authored Dec 21, 2019
2 parents 83f429c + 75a7f47 commit 42b8d42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
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

0 comments on commit 42b8d42

Please sign in to comment.