瀏覽代碼

Corrected regression with preference files name

Signed-off-by: Vincent Deygas <Vincent.Deygas@rewardgateway.com>
Vincent 8 年之前
父節點
當前提交
a531b2b424
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      manifests/params.pp
  2. 1 1
      manifests/setting.pp
  3. 1 1
      spec/defines/setting_spec.rb

+ 1 - 1
manifests/params.pp

@@ -61,7 +61,7 @@ class apt::params {
     },
     'pref'   => {
       'path' => $preferences_d,
-      'ext'  => '',
+      'ext'  => '.pref',
     },
     'list'   => {
       'path' => $sources_list_d,

+ 1 - 1
manifests/setting.pp

@@ -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

+ 1 - 1
spec/defines/setting_spec.rb

@@ -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