From: Daniele Sluijters Date: Tue, 24 Feb 2015 20:43:36 +0000 (+0100) Subject: apt::params: Make the class private. X-Git-Tag: 2.0.0~35^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3b5145bf51c0a887233b7d97208b9329aefc2d64;p=puppet-modules%2Fpuppetlabs-apt.git apt::params: Make the class private. Prevent direct access to apt::params. This will ensure that any other module cannot blindly access apt::params and get settings that have been potentially overridden at the apt level. Our own module still can since any class in apt has a module_name of 'apt' but that's up to us to prevent from happening. Every setting must now be accessed by a qualified lookup into the apt namespace. --- diff --git a/manifests/params.pp b/manifests/params.pp index 765677f..8f9d7e8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,4 +1,9 @@ class apt::params { + + if $caller_module_name and $caller_module_name != $module_name { + fail('apt::params is a private class and cannot be accessed directly') + } + $root = '/etc/apt' $provider = '/usr/bin/apt-get' $sources_list = "${root}/sources.list"