From 00ccd2ee6e7ced5b5d7556ed466979ceeacfe3a2 Mon Sep 17 00:00:00 2001 From: Bernhard Lichtinger Date: Mon, 26 Oct 2015 14:22:21 +0100 Subject: [PATCH] Fix for SLES 11.4, which has now also an /etc/os-release file. --- lib/ansible/module_utils/facts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 1ba61bb77f0..4c7571ce3c5 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -418,9 +418,9 @@ class Facts(object): release = re.search("^PRETTY_NAME=[^(]+ \(?([^)]+?)\)", line) if release: self.facts['distribution_release'] = release.groups()[0] - elif 'enterprise' in data.lower(): + elif 'enterprise' in data.lower() and 'VERSION_ID' in line: release = re.search('^VERSION_ID="?[0-9]+\.?([0-9]*)"?', line) # SLES doesn't got funny release names - if release: + if release.group(1): release = release.group(1) else: release = "0" # no minor number, so it is the first release