(FM-7348) - OS logic cleanup
authorEimhin Laverty <eimhin.laverty@puppet.com>
Mon, 10 Sep 2018 10:22:04 +0000 (11:22 +0100)
committerEimhin Laverty <eimhin.laverty@puppet.com>
Mon, 10 Sep 2018 10:22:33 +0000 (11:22 +0100)
manifests/backports.pp
spec/classes/apt_spec.rb

index 62927cdac7d1dada0a720dfac5b72a67a55a1e9e..0fa69586e78089a3e38a867b59b2e4ffcc0be79c 100644 (file)
@@ -64,24 +64,23 @@ class apt::backports (
   if $key {
     $_key = $key
   }
-  if ($facts['lsbdistid'] == 'Debian' or $facts['lsbdistid'] == 'Ubuntu') {
-    unless $location {
-      $_location = $::apt::backports['location']
-    }
-    unless $release {
-      $_release = "${facts['lsbdistcodename']}-backports"
-    }
-    unless $repos {
-      $_repos = $::apt::backports['repos']
-    }
-    unless $key {
-      $_key =  $::apt::backports['key']
-    }
-  } else {
+  if (!($facts['lsbdistid'] == 'Debian' or $facts['lsbdistid'] == 'Ubuntu')) {
     unless $location and $release and $repos and $key {
       fail(translate('If not on Debian or Ubuntu, you must explicitly pass location, release, repos, and key'))
     }
   }
+  unless $location {
+    $_location = $::apt::backports['location']
+  }
+  unless $release {
+    $_release = "${facts['lsbdistcodename']}-backports"
+  }
+  unless $repos {
+    $_repos = $::apt::backports['repos']
+  }
+  unless $key {
+    $_key =  $::apt::backports['key']
+  }
 
   if $pin =~ Hash {
     $_pin = $pin
index 011286d876bc96fd78cf9a73a81e233a2b160252..f93770e234d004547608cf05e31c7c55aa43557e 100644 (file)
@@ -35,7 +35,7 @@ preferences_d = { ensure: 'directory',
 describe 'apt' do
   let(:facts) do
     {
-      os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
+      os: { family: 'Debian', name: 'Debian', release: { major: '8', full: '8.0' } },
       lsbdistid: 'Debian',
       osfamily: 'Debian',
       lsbdistcodename: 'wheezy',