Skip to content

Commit 89fceb4

Browse files
author
Morgan Haskel
committed
Merge pull request #354 from bmjen/merge-master
Merge master into 1.2.x
2 parents 35958b3 + d336ea0 commit 89fceb4

File tree

11 files changed

+105
-52
lines changed

11 files changed

+105
-52
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
sudo: false
23
language: ruby
34
bundler_args: --without system_tests
45
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
@@ -11,5 +12,7 @@ matrix:
1112
env: PUPPET_GEM_VERSION="~> 3.0"
1213
- rvm: 2.0.0
1314
env: PUPPET_GEM_VERSION="~> 3.0"
15+
- rvm: 2.1.6
16+
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
1417
notifications:
1518
email: false

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
##2015-06-02 - Supported Release 2.0.1 [YANKED]
2+
###Summary
3+
4+
This is a bugfix release.
5+
6+
####Bugfixes
7+
- Fixes dependency graphing with concurrent modification of the same file.
8+
- Fixes handling fragment target.
9+
- Fixes the defaulted force behavior to handle empty concats correctly.
10+
111
##2015-06-02 - Supported Release 1.2.3
212
###Summary
313

@@ -7,6 +17,17 @@ This release includes a README fix to document correct behavior of fragment targ
717

818
- README Fix to correctly document how a fragment $target param should work.
919

20+
##2015-05-12 - Supported Release 2.0.0 [YANKED]
21+
###Summary
22+
23+
This is a major release. Includes re-implementation of concat to use native Type and Providers, resulting in significantly improved performance and testability. Also includes a bugfix to alpha ordering of fragments.
24+
25+
####Features
26+
- Re-implementation of concat to use native Type and Providers.
27+
28+
####Bugfixes
29+
- Fixes a bug in alpha ordering of fragments.
30+
1031
##2015-05-12 - Supported Release 1.2.2
1132
###Summary
1233

Gemfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,18 @@ def location_for(place, fake_version = nil)
1111
end
1212

1313
group :development, :unit_tests do
14-
gem 'rake', :require => false
1514
gem 'rspec-core', '3.1.7', :require => false
16-
gem 'rspec-puppet', '~> 1.0', :require => false
1715
gem 'puppetlabs_spec_helper', :require => false
18-
gem 'puppet-lint', :require => false
1916
gem 'simplecov', :require => false
2017
gem 'puppet_facts', :require => false
2118
gem 'json', :require => false
2219
end
2320

24-
beaker_version = ENV['BEAKER_VERSION']
25-
beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
2621
group :system_tests do
27-
if beaker_version
22+
if beaker_version = ENV['BEAKER_VERSION']
2823
gem 'beaker', *location_for(beaker_version)
2924
end
30-
if beaker_rspec_version
25+
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
3126
gem 'beaker-rspec', *location_for(beaker_rspec_version)
3227
else
3328
gem 'beaker-rspec', :require => false
@@ -36,14 +31,16 @@ group :system_tests do
3631
gem 'beaker-puppet_install_helper', :require => false
3732
end
3833

34+
35+
3936
if facterversion = ENV['FACTER_GEM_VERSION']
40-
gem 'facter', *location_for(facterversion)
37+
gem 'facter', facterversion, :require => false
4138
else
4239
gem 'facter', :require => false
4340
end
4441

4542
if puppetversion = ENV['PUPPET_GEM_VERSION']
46-
gem 'puppet', *location_for(puppetversion)
43+
gem 'puppet', puppetversion, :require => false
4744
else
4845
gem 'puppet', :require => false
4946
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ The `concat::setup` class should no longer be directly included in the manifest.
268268

269269
##Limitations
270270

271-
This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified.
271+
This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified. Additionally, it is tested (but not supported) on Solaris 12.
272272

273273
##Development
274274

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-lint/tasks/puppet-lint'
33

4-
PuppetLint.configuration.fail_on_warnings
4+
PuppetLint.configuration.fail_on_warnings = true
55
PuppetLint.configuration.send('relative')
66
PuppetLint.configuration.send('disable_80chars')
77
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

manifests/init.pp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,18 @@
104104
true: {
105105
$warn_message = $default_warn_message
106106
}
107+
# lint:ignore:quoted_booleans
107108
'true', 'yes', 'on': {
109+
# lint:endignore
108110
warning($bool_warn_message)
109111
$warn_message = $default_warn_message
110112
}
111113
false: {
112114
$warn_message = ''
113115
}
116+
# lint:ignore:quoted_booleans
114117
'false', 'no', 'off': {
118+
# lint:endignore
115119
warning($bool_warn_message)
116120
$warn_message = ''
117121
}
@@ -201,14 +205,16 @@
201205
$command = strip(regsubst("${script_command} -o \"${fragdir}/${concat_name}\" -d \"${fragdir}\" ${warnflag} ${forceflag} ${orderflag} ${newlineflag}", '\s+', ' ', 'G'))
202206

203207
# make sure ruby is in the path for PE
204-
if defined('$is_pe') and $::is_pe {
208+
if defined('$is_pe') and str2bool("${::is_pe}") { # lint:ignore:only_variable_string
205209
if $::kernel == 'windows' {
206210
$command_path = "${::env_windows_installdir}/bin:${::path}"
207211
} else {
208-
$command_path = "/opt/puppet/bin:${::path}"
212+
$command_path = "/opt/puppetlabs/puppet/bin:/opt/puppet/bin:${::path}"
209213
}
210-
} else {
214+
} elsif $::kernel == 'windows' {
211215
$command_path = $::path
216+
} else {
217+
$command_path = "/opt/puppetlabs/puppet/bin:${::path}"
212218
}
213219

214220
# if puppet is running as root, this exec should also run as root to allow
@@ -246,7 +252,9 @@
246252
# lint:ignore:quoted_booleans
247253
$absent_exec_command = $::kernel ? {
248254
'windows' => 'cmd.exe /c exit 0',
255+
# lint:ignore:quoted_booleans
249256
default => 'true',
257+
# lint:endignore
250258
}
251259
# lint:endignore
252260

manifests/setup.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
$script_command = $::osfamily? {
4545
'windows' => "ruby.exe '${script_path}'",
4646
'openbsd' => "/usr/local/bin/ruby21 '${script_path}'",
47+
'freebsd' => "/usr/local/bin/ruby '${script_path}'",
4748
default => $script_path
4849
}
4950

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"operatingsystem": "Solaris",
6868
"operatingsystemrelease": [
6969
"10",
70-
"11"
70+
"11",
71+
"12"
7172
]
7273
},
7374
{

spec/acceptance/concat_spec.rb

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,40 @@
55
username = 'root'
66
groupname = 'system'
77
scriptname = 'concatfragments.rb'
8-
vardir = default['puppetvardir']
8+
vardir = default.puppet['vardir']
9+
if vardir.nil? or vardir == ''
10+
vardir = '/opt/puppetlabs/puppet/cache'
11+
end
912
when 'Darwin'
1013
username = 'root'
1114
groupname = 'wheel'
1215
scriptname = 'concatfragments.rb'
13-
vardir = default['puppetvardir']
16+
vardir = default.puppet['vardir']
17+
if vardir.nil? or vardir == ''
18+
vardir = '/opt/puppetlabs/puppet/cache'
19+
end
1420
when 'windows'
1521
username = 'Administrator'
1622
groupname = 'Administrators'
1723
scriptname = 'concatfragments.rb'
18-
result = on default, "echo #{default['puppetvardir']}"
24+
result = on default, "echo #{default.puppet['vardir']}"
1925
vardir = result.raw_output.chomp
2026
when 'Solaris'
2127
username = 'root'
2228
groupname = 'root'
2329
scriptname = 'concatfragments.rb'
24-
vardir = default['puppetvardir']
30+
vardir = default.puppet['vardir']
31+
if vardir.nil? or vardir == ''
32+
vardir = '/opt/puppetlabs/puppet/cache'
33+
end
2534
else
2635
username = 'root'
2736
groupname = 'root'
2837
scriptname = 'concatfragments.rb'
29-
vardir = default['puppetvardir']
38+
vardir = default.puppet['vardir']
39+
if vardir.nil? or vardir == ''
40+
vardir = '/opt/puppetlabs/puppet/cache'
41+
end
3042
end
3143

3244
describe 'basic concat test' do

spec/unit/defines/concat_fragment_spec.rb

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,21 @@
4646
should contain_file("#{fragdir}/fragments/#{p[:order]}_#{safe_name}").with({
4747
:ensure => safe_ensure,
4848
:owner => id,
49-
:group => gid,
5049
:mode => '0640',
5150
:source => p[:source],
5251
:content => p[:content],
5352
:alias => "concat_fragment_#{title}",
5453
:backup => 'puppet',
5554
})
55+
# The defined() function doesn't seem to work properly with puppet 3.4 and rspec.
56+
# defined() works on its own, rspec works on its own, but together they
57+
# determine that $gid is not defined and cause errors here. Work around
58+
# it by ignoring this check for older puppet version.
59+
if Puppet::Util::Package.versioncmp(Puppet.version, '3.5.0') >= 0
60+
should contain_file("#{fragdir}/fragments/#{p[:order]}_#{safe_name}").with({
61+
:group => gid,
62+
})
63+
end
5664
end
5765
end
5866

@@ -79,7 +87,7 @@
7987
let(:params) {{ :target => false }}
8088

8189
it 'should fail' do
82-
expect { should }.to raise_error(Puppet::Error, /is not a string/)
90+
expect { catalogue }.to raise_error(Puppet::Error, /is not a string/)
8391
end
8492
end
8593
end # target =>
@@ -121,7 +129,7 @@
121129
let(:params) {{ :content => false, :target => '/etc/motd' }}
122130

123131
it 'should fail' do
124-
expect { should }.to raise_error(Puppet::Error, /is not a string/)
132+
expect { catalogue }.to raise_error(Puppet::Error, /is not a string/)
125133
end
126134
end
127135
end # content =>
@@ -142,7 +150,7 @@
142150
let(:params) {{ :source => false, :target => '/etc/motd' }}
143151

144152
it 'should fail' do
145-
expect { should }.to raise_error(Puppet::Error, /is not a string or an Array/)
153+
expect { catalogue }.to raise_error(Puppet::Error, /is not a string or an Array/)
146154
end
147155
end
148156
end # source =>
@@ -163,7 +171,7 @@
163171
let(:params) {{ :order => false, :target => '/etc/motd' }}
164172

165173
it 'should fail' do
166-
expect { should }.to raise_error(Puppet::Error, /is not a string or integer/)
174+
expect { catalogue }.to raise_error(Puppet::Error, /is not a string or integer/)
167175
end
168176
end
169177

@@ -173,7 +181,7 @@
173181
let(:params) {{ :order => '123:456', :target => '/etc/motd' }}
174182

175183
it 'should fail' do
176-
expect { should }.to raise_error(Puppet::Error, /cannot contain/)
184+
expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
177185
end
178186
end
179187
context '123/456' do
@@ -182,7 +190,7 @@
182190
let(:params) {{ :order => '123/456', :target => '/etc/motd' }}
183191

184192
it 'should fail' do
185-
expect { should }.to raise_error(Puppet::Error, /cannot contain/)
193+
expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
186194
end
187195
end
188196
context '123\n456' do
@@ -191,7 +199,7 @@
191199
let(:params) {{ :order => "123\n456", :target => '/etc/motd' }}
192200

193201
it 'should fail' do
194-
expect { should }.to raise_error(Puppet::Error, /cannot contain/)
202+
expect { catalogue }.to raise_error(Puppet::Error, /cannot contain/)
195203
end
196204
end
197205
end # order =>
@@ -219,7 +227,7 @@
219227
end
220228

221229
it 'should fail' do
222-
expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
230+
expect { catalogue }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
223231
end
224232
end
225233

@@ -243,7 +251,7 @@
243251
end
244252

245253
it 'should fail' do
246-
expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
254+
expect { catalogue }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
247255
end
248256
end
249257

@@ -267,7 +275,7 @@
267275
end
268276

269277
it 'should fail' do
270-
expect { should }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
278+
expect { catalogue }.to raise_error(Puppet::Error, /#{Regexp.escape(error_msg)}/m)
271279
end
272280
end
273281

0 commit comments

Comments
 (0)