From 13da2c3ac9fc217be51c017fb6f149ef19773edf Mon Sep 17 00:00:00 2001 From: gservat Date: Wed, 27 Nov 2013 23:44:34 +1100 Subject: [PATCH 1/3] Added support for parsing in the SLES patch level correctly On SLES, the setup module was returning the architecture as the distribution version (i.e. platform.dist() didn't quite return the right thing). This change checks for /etc/SuSE-release and grabs the second column in the third line as distribution_version. --- library/system/setup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/system/setup b/library/system/setup index 7b0fd70e80..90c87d486c 100755 --- a/library/system/setup +++ b/library/system/setup @@ -117,7 +117,8 @@ class Facts(object): '/etc/system-release': 'OtherLinux', '/etc/alpine-release': 'Alpine', '/etc/release': 'Solaris', - '/etc/arch-release': 'Archlinux' } + '/etc/arch-release': 'Archlinux', + '/etc/SuSE-release': 'SuSE' } SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' } # A list of dicts. If there is a platform with more than one @@ -324,6 +325,9 @@ class Facts(object): self.facts['distribution'] = data.split()[0] self.facts['distribution_version'] = data.split()[1] self.facts['distribution_release'] = ora_prefix + data + elif name == 'SuSE': + data = get_file_content(path).splitlines() + self.facts['distribution_version'] = data.split[2].split('=')[1].strip() else: self.facts['distribution'] = name From 83f35a63dd006e3f7b2eeb2128e5ad6828465192 Mon Sep 17 00:00:00 2001 From: gservat Date: Fri, 6 Dec 2013 07:49:03 +1100 Subject: [PATCH 2/3] Oops... fixed an error --- library/system/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/system/setup b/library/system/setup index 90c87d486c..5783b0b9b0 100755 --- a/library/system/setup +++ b/library/system/setup @@ -327,7 +327,7 @@ class Facts(object): self.facts['distribution_release'] = ora_prefix + data elif name == 'SuSE': data = get_file_content(path).splitlines() - self.facts['distribution_version'] = data.split[2].split('=')[1].strip() + self.facts['distribution_version'] = data[2].split('=')[1].strip() else: self.facts['distribution'] = name From db2f41bdcb49dd566de48e776e6b5d589f642677 Mon Sep 17 00:00:00 2001 From: gservat Date: Fri, 6 Dec 2013 07:53:39 +1100 Subject: [PATCH 3/3] This change is meant to replace distribution_release, not version! --- library/system/setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/system/setup b/library/system/setup index 5783b0b9b0..057e9fd337 100755 --- a/library/system/setup +++ b/library/system/setup @@ -327,7 +327,7 @@ class Facts(object): self.facts['distribution_release'] = ora_prefix + data elif name == 'SuSE': data = get_file_content(path).splitlines() - self.facts['distribution_version'] = data[2].split('=')[1].strip() + self.facts['distribution_release'] = data[2].split('=')[1].strip() else: self.facts['distribution'] = name