]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
This class should be private
authorBen Ford <ben.ford@puppetlabs.com>
Fri, 10 Feb 2017 00:28:45 +0000 (16:28 -0800)
committerGitHub <noreply@github.com>
Fri, 10 Feb 2017 00:28:45 +0000 (16:28 -0800)
Provides a more useful error message when users try to use this class by itself. Without this fix, you'll get something like

```
Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /etc/puppetlabs/code/environments/production/modules/apt/manifests/update.pp:7:8"?
```

manifests/update.pp

index 4a8a7c8c21be204eb104da03139fbfdf2d89a45e..516252001f5a7be3642fa055f0c4e67d3ab05cc6 100644 (file)
@@ -1,4 +1,6 @@
 class apt::update {
+  assert_private 
+  
   #TODO: to catch if $::apt_update_last_success has the value of -1 here. If we
   #opt to do this, a info/warn would likely be all you'd need likely to happen
   #on the first run, but if it's not run in awhile something is likely borked