From e34eac0996dd1b6d376c0a974a0ca090d285888f Mon Sep 17 00:00:00 2001 From: Bill ONeill Date: Thu, 2 Apr 2015 13:18:08 -0400 Subject: [PATCH 1/2] (MODULES-1700) Change the filebucketing behavior so static_compiler can handle them --- manifests/fragment.pp | 3 ++- manifests/setup.pp | 4 ---- spec/acceptance/nodesets/default.yml | 6 +++--- spec/unit/classes/concat_setup_spec.rb | 4 ---- spec/unit/defines/concat_fragment_spec.rb | 2 +- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/manifests/fragment.pp b/manifests/fragment.pp index b6a2b0232..f9ee2a7ca 100644 --- a/manifests/fragment.pp +++ b/manifests/fragment.pp @@ -57,6 +57,7 @@ if $backup { warning('The $backup parameter to concat::fragment is deprecated and has no effect') } + $my_backup = concat_getparam(Concat[$target], 'backup') if $ensure == undef { $my_ensure = concat_getparam(Concat[$target], 'ensure') } else { @@ -118,7 +119,7 @@ mode => $fragmode, source => $source, content => $content, - backup => false, + backup => $my_backup, replace => true, alias => "concat_fragment_${name}", notify => Exec["concat_${target}"] diff --git a/manifests/setup.pp b/manifests/setup.pp index 3d3472510..c5aedd82b 100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp @@ -47,10 +47,6 @@ default => $script_path } - File { - backup => false, - } - file { $script_path: ensure => file, owner => $default_owner, diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml index 063983549..b82685158 100644 --- a/spec/acceptance/nodesets/default.yml +++ b/spec/acceptance/nodesets/default.yml @@ -1,10 +1,10 @@ HOSTS: - centos-64-x64: + centos-66-x64: roles: - master platform: el-6-x86_64 - box : centos-64-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box + box : puppetlabs/centos-6.6-64-nocm + box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-6.6-64-nocm hypervisor : vagrant CONFIG: type: git diff --git a/spec/unit/classes/concat_setup_spec.rb b/spec/unit/classes/concat_setup_spec.rb index 84ba282c2..c6ff93e0a 100644 --- a/spec/unit/classes/concat_setup_spec.rb +++ b/spec/unit/classes/concat_setup_spec.rb @@ -21,7 +21,6 @@ :owner => 'root', :group => 0, :source => 'puppet:///modules/concat/concatfragments.rb', - :backup => false, }) end @@ -32,7 +31,6 @@ :mode => '0755', :owner => 'root', :group => 0, - :backup => false, }) end end @@ -71,7 +69,6 @@ :group => 0, :mode => '0755', :source => 'puppet:///modules/concat/concatfragments.rb', - :backup => false, }) end end # on osfamily Solaris @@ -95,7 +92,6 @@ :group => nil, :mode => nil, :source => 'puppet:///modules/concat/concatfragments.rb', - :backup => false, }) end end # on osfamily windows diff --git a/spec/unit/defines/concat_fragment_spec.rb b/spec/unit/defines/concat_fragment_spec.rb index 1dc7c38f4..6cf3e4296 100644 --- a/spec/unit/defines/concat_fragment_spec.rb +++ b/spec/unit/defines/concat_fragment_spec.rb @@ -51,7 +51,7 @@ :source => p[:source], :content => p[:content], :alias => "concat_fragment_#{title}", - :backup => false, + :backup => 'puppet', }) end end From aa133e24e425fee4c6460044d1ec30c25d85a430 Mon Sep 17 00:00:00 2001 From: Bill ONeill Date: Mon, 6 Apr 2015 11:49:11 -0400 Subject: [PATCH 2/2] Override File default with backup value instead of assuming 'false' --- manifests/init.pp | 2 +- spec/unit/defines/concat_spec.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index fa05a1004..c44c03284 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -141,7 +141,7 @@ } File { - backup => false, + backup => $backup, } # reset poisoned Exec defaults diff --git a/spec/unit/defines/concat_spec.rb b/spec/unit/defines/concat_spec.rb index a748f9607..115a0f55b 100644 --- a/spec/unit/defines/concat_spec.rb +++ b/spec/unit/defines/concat_spec.rb @@ -29,7 +29,7 @@ default_warn_message = '# This file is managed by Puppet. DO NOT EDIT.' file_defaults = { - :backup => false, + :backup => p[:backup], } let(:title) { title } @@ -138,7 +138,6 @@ it do should contain_file(file).with(file_defaults.merge({ :ensure => 'absent', - :backup => false, :force => true, })) end