From a991b62a51853f0c8c64be16ba4359b9593be7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Wed, 18 Sep 2013 11:47:39 +0200 Subject: [PATCH] apt_repository: fix update cache after state=changed. Closes GH-4136 --- library/packaging/apt_repository | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/packaging/apt_repository b/library/packaging/apt_repository index a61a93b586..5ec6bd4902 100644 --- a/library/packaging/apt_repository +++ b/library/packaging/apt_repository @@ -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))