def collect_installed_packages(results): """ Collect all installed packages for the selected hosts and store them in env """ print env.host pkg_info = PackageInfo() results[env.host] = pkg_info.installed_packages()
def installed_packages(prefix=None): """ Cache the set of packages installed on the selected host. """ pkg_info = PackageInfo() env.package_descriptors = [ package for package in pkg_info.installed_packages() if prefix is None or package.name.startswith(prefix) ]