From 301c8b8e09573987e0f4c2f6f71bd71bd2f4bcf5 Mon Sep 17 00:00:00 2001 From: fabios Date: Thu, 25 Dec 2014 14:14:01 -0500 Subject: [PATCH] handle list of list for python-apt < 0.7.9 compatibility --- lib/ansible/modules/packaging/os/apt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/apt.py b/lib/ansible/modules/packaging/os/apt.py index 43a7d6b390b..7eba3432e60 100644 --- a/lib/ansible/modules/packaging/os/apt.py +++ b/lib/ansible/modules/packaging/os/apt.py @@ -180,7 +180,8 @@ def package_versions(pkgname, pkg, pkg_cache): # assume older version of python-apt is installed # apt.package.Package#versions require python-apt >= 0.7.9. pkg_cache_list = (p for p in pkg_cache.Packages if p.Name == pkgname) - pkg_versions = (p.VersionList for p in pkg_cache_list) + pkg_list_of_lists = (p.VersionList for p in pkg_cache_list) + pkg_versions = (p for l in pkg_list_of_lists for p in l) versions = set(p.VerStr for p in pkg_versions) return versions