Fix for duplicate entries with pkrepo.managed

pkgrepo.managed creates duplicate entries every time salt runs
  when the same repository is set up twice, with different file attributes.

  This change simply removes the file attributes before comparing if the
  repo already exists.

  This might be related to #22412.
This commit is contained in:
Andreas Putzo 2018-01-22 12:57:12 +01:00 committed by rallytime
parent bd2178cd5f
commit 9653363131
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -377,6 +377,9 @@ def managed(name, ppa=None, **kwargs):
repo = salt.utils.pkg.deb.strip_uri(repo)
if pre:
#22412: Remove file attribute in case same repo is set up multiple times but with different files
pre.pop('file', None)
sanitizedkwargs.pop('file', None)
for kwarg in sanitizedkwargs:
if kwarg not in pre:
if kwarg == 'enabled':