diff --git a/.fixtures.yml b/.fixtures.yml index dc6b41f..67added 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -2,6 +2,6 @@ fixtures: repositories: 'stdlib': repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git' - ref: '4.0.0' + ref: '4.2.0' symlinks: 'concat': '#{source_dir}' diff --git a/Modulefile b/Modulefile index ea9ef2c..bc1f199 100644 --- a/Modulefile +++ b/Modulefile @@ -6,4 +6,4 @@ license 'Apache 2.0' summary 'Concat module' description 'Concat module' project_page 'http://github.com/puppetlabs/puppetlabs-concat' -dependency 'puppetlabs/stdlib', '>= 4.0.0' +dependency 'puppetlabs/stdlib', '>= 4.2.0' diff --git a/README.md b/README.md index 60eca38..3f26ee7 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ class motd { } # used by other modules to register themselves in the motd -define motd::register($content="", $order=10) { +define motd::register($content="", $order='10') { if $content == "" { $body = $name } else { @@ -247,6 +247,8 @@ Order the fragments. ######Example - order => '01' +Best practice is to pass a string to this parameter but integer values are accepted. + #####`ensure` Control the file of fragment created. diff --git a/manifests/fragment.pp b/manifests/fragment.pp index a51b8c2..daa6a23 100644 --- a/manifests/fragment.pp +++ b/manifests/fragment.pp @@ -40,7 +40,9 @@ define concat::fragment( if !(is_string($source) or is_array($source)) { fail('$source is not a string or an Array.') } - validate_string($order) + if !(is_string($order) or is_integer($order)) { + fail('$order is not a string or integer.') + } if $mode { warning('The $mode parameter to concat::fragment is deprecated and has no effect') } diff --git a/spec/unit/defines/concat_fragment_spec.rb b/spec/unit/defines/concat_fragment_spec.rb index 3b5269e..3c61aab 100644 --- a/spec/unit/defines/concat_fragment_spec.rb +++ b/spec/unit/defines/concat_fragment_spec.rb @@ -152,7 +152,7 @@ describe 'concat::fragment', :type => :define do let(:params) {{ :order => false, :target => '/etc/motd' }} it 'should fail' do - expect { should }.to raise_error(Puppet::Error, /is not a string/) + expect { should }.to raise_error(Puppet::Error, /is not a string or integer/) end end end # order =>