From 772b7d201ec5287d179df1b08c865c8436cc0fc1 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 24 Nov 2015 12:15:37 -0500 Subject: [PATCH] Add SUSE, OpenSuse and Debian to scan_packages Also strip the output of get_distribution() since the suse variants seem to have extra whitespace in the string output. --- awx/plugins/library/scan_packages.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/awx/plugins/library/scan_packages.py b/awx/plugins/library/scan_packages.py index b7398ab202..e275144cd1 100755 --- a/awx/plugins/library/scan_packages.py +++ b/awx/plugins/library/scan_packages.py @@ -71,11 +71,13 @@ def deb_package_list(): def main(): module = AnsibleModule( argument_spec = dict()) - - ans_dist = get_distribution() - if ans_dist in ('Centos', 'Centos linux', 'Red hat enterprise linux server', 'Amazon'): + import os + os.system('echo "%s" > /tmp/foo' % get_distribution()) + ans_dist = get_distribution().strip() + if ans_dist in ('Centos', 'Centos linux', 'Red hat enterprise linux server', 'Amazon', 'Suse linux enterprise server', 'Opensuse'): + os.system('echo "in rpm_package_list for %s" >> /tmp/foo' % ans_dist) packages = rpm_package_list() - elif ans_dist in ('Ubuntu'): + elif ans_dist in ('Ubuntu', 'Debian'): packages = deb_package_list() else: packages = None