mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
apt_repository: fix update cache after state=changed. Closes GH-4136
This commit is contained in:
parent
a563ea1340
commit
a991b62a51
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,7 @@ import re
|
|||
import tempfile
|
||||
|
||||
try:
|
||||
import apt
|
||||
import apt_pkg
|
||||
import aptsources.distro
|
||||
distro = aptsources.distro.get_distro()
|
||||
|
@ -365,6 +366,8 @@ def main():
|
|||
if not module.check_mode and changed:
|
||||
try:
|
||||
sourceslist.save(module)
|
||||
cache = apt.Cache()
|
||||
cache.update()
|
||||
except OSError as err:
|
||||
module.fail_json(msg=unicode(err))
|
||||
|
||||
|
|
Loading…
Reference in a new issue