Corrected regression with preference files name
authorVincent <Vincent--@users.noreply.github.com>
Mon, 24 Aug 2015 16:53:02 +0000 (17:53 +0100)
committerVincent Deygas <Vincent.Deygas@rewardgateway.com>
Wed, 2 Sep 2015 11:06:16 +0000 (12:06 +0100)
Signed-off-by: Vincent Deygas <Vincent.Deygas@rewardgateway.com>
manifests/params.pp
manifests/setting.pp
spec/defines/setting_spec.rb

index ea184606545e3d341b7f39b88f8ac55c58f73576..861a6af34f8b8f62b8c379156ea3ea450503dea7 100644 (file)
@@ -61,7 +61,7 @@ class apt::params {
     },
     'pref'   => {
       'path' => $preferences_d,
-      'ext'  => '',
+      'ext'  => '.pref',
     },
     'list'   => {
       'path' => $sources_list_d,
index d723eb2c53103b0db61f7a3bf3155620d90ace90..b0fb62b1debd8fb5d90c1f86cb0f0bdc5e778a7f 100644 (file)
@@ -37,7 +37,7 @@ define apt::setting (
     validate_string($content)
   }
 
-  if $setting_type == 'list' {
+  if ($setting_type == 'list') or ($setting_type == 'pref') {
     $_priority = ''
   } else {
     $_priority = $priority
index 07d94ef4802e8b38bc8debe3371986c9f910794f..a326bdbdd3239c400319eb199b127ef88f5fe6a7 100644 (file)
@@ -22,7 +22,7 @@ describe 'apt::setting' do
     context 'with title=pref-teddybear' do
       let(:title) { 'pref-teddybear' }
       let(:params) { default_params }
-      it { is_expected.to contain_file('/etc/apt/preferences.d/50teddybear').that_notifies('Class[Apt::Update]') }
+      it { is_expected.to contain_file('/etc/apt/preferences.d/teddybear.pref').that_notifies('Class[Apt::Update]') }
     end
 
     context 'with title=list-teddybear' do