]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
On a sid system, $lsbdistcodename is reports 'n/a', this doesn't work because the...
authorMicah Anderson <micah@riseup.net>
Tue, 18 Dec 2012 21:45:38 +0000 (16:45 -0500)
committerMicah Anderson <micah@riseup.net>
Tue, 18 Dec 2012 21:45:38 +0000 (16:45 -0500)
looks for a template based on the $lsbdistcodename, so you get this error:

      Could not find template 'apt/Debian/preferences_n/a.erb'

The slash in 'n/a' appears to be a path (confusing!)

So I've set an error message when 'n/a' is encountered, encouraging the user to set the $lsbdistcodename.

I was not confident in the idea of pointing any occurrence of 'n/a' to the sid
templates, as I could imagine a case where this might occur on a non-sid system
where the lsbdistcodename isn't properly detected

manifests/init.pp

index 2ae691fa61c4aead194414975ab311a206580297..802da3acb165e6afe405683392ed5ce71e004fe6 100644 (file)
@@ -68,6 +68,9 @@ class apt {
       $codename = $lsbdistcodename
       $release = $lsbdistrelease
     }
+    'n/a': {
+      fail("Unknown lsbdistcodename reported by facter: '$lsbdistcodename', please fix this by setting this variable in your manifest.")
+    } 
     default: {
       $codename = $lsbdistcodename
       $release = debian_release($codename)