Browse code

fixed ubuntu facts for all versions made sure NA is option of last resort

Brian Coca authored on 2015/05/30 05:13:30
Showing 3 changed files
... ...
@@ -99,8 +99,9 @@ class Facts(object):
99 99
                     ('/etc/os-release', 'SuSE'),
100 100
                     ('/etc/gentoo-release', 'Gentoo'),
101 101
                     ('/etc/os-release', 'Debian'),
102
+                    ('/etc/lsb-release', 'Mandriva'),
102 103
                     ('/etc/os-release', 'NA'),
103
-                    ('/etc/lsb-release', 'Mandriva'))
104
+                )
104 105
     SELINUX_MODE_DICT = { 1: 'enforcing', 0: 'permissive', -1: 'disabled' }
105 106
 
106 107
     # A list of dicts.  If there is a platform with more than one
... ...
@@ -416,11 +417,13 @@ class Facts(object):
416 416
                                                 self.facts['distribution_version'] = self.facts['distribution_version'] + '.' + release.group(1)
417 417
                         elif name == 'Debian':
418 418
                             data = get_file_content(path)
419
-                            if 'Debian' in data or 'Raspbian' in data:
419
+                            if 'Ubuntu' in data:
420
+                                break # Ubuntu gets correct info from python functions
421
+                            elif 'Debian' in data or 'Raspbian' in data:
420 422
                                 release = re.search("PRETTY_NAME=[^(]+ \(?([^)]+?)\)", data)
421 423
                                 if release:
422 424
                                     self.facts['distribution_release'] = release.groups()[0]
423
-                                break
425
+                                    break
424 426
                         elif name == 'Mandriva':
425 427
                             data = get_file_content(path)
426 428
                             if 'Mandriva' in data:
... ...
@@ -1 +1 @@
1
-Subproject commit 5983d64d7728ea88ef27606e95e4aa34cde5ff46
1
+Subproject commit 9cc23c749a8cd5039db7aa1998d310bbb04d1e13
... ...
@@ -1 +1 @@
1
-Subproject commit 1276420a3a39340fcd9e053a1e621cdd89f480fa
1
+Subproject commit a07fc88ba0d2546b92fbe93b2bede699fdf2bc48