Skip to content

Commit 73c7896

Browse files
committed
Merge pull request redhat-openstack#239 from mhaskel/pull_master_to_1.1.x
Pull master to 1.1.x
2 parents 0f43e1a + fe9730a commit 73c7896

9 files changed

Lines changed: 77 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is a bugfix release, and the first supported release of the 1.1.x series.
88
- Make the `$order` parameter default to a string and be validated as an integer
99
or a string
1010
- Use the ruby script on Solaris to not break Sol10 support
11-
- Add quotes to the ryby script location for Windows
11+
- Add quotes to the ruby script location for Windows
1212
- Fix typos in README.md
1313
- Make regex in concat::setup case-insensitive to make it work on Windows
1414
- Make sure concat fragments are always replaced

metadata.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
{
4444
"operatingsystem": "SLES",
4545
"operatingsystemrelease": [
46-
"11 SP1"
46+
"10 SP4",
47+
"11 SP1",
48+
"12"
4749
]
4850
},
4951
{

spec/acceptance/concat_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,49 +42,49 @@
4242
describe file("#{vardir}/concat") do
4343
it { should be_directory }
4444
it { should be_owned_by username }
45-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
45+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
4646
should be_mode 755
4747
}
4848
end
4949
describe file("#{vardir}/concat/bin") do
5050
it { should be_directory }
5151
it { should be_owned_by username }
52-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
52+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
5353
should be_mode 755
5454
}
5555
end
5656
describe file("#{vardir}/concat/bin/#{scriptname}") do
5757
it { should be_file }
5858
it { should be_owned_by username }
59-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
59+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
6060
should be_mode 755
6161
}
6262
end
6363
describe file("#{vardir}/concat/#{safe_basedir}_file") do
6464
it { should be_directory }
6565
it { should be_owned_by username }
66-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
66+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
6767
should be_mode 750
6868
}
6969
end
7070
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments") do
7171
it { should be_directory }
7272
it { should be_owned_by username }
73-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
73+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
7474
should be_mode 750
7575
}
7676
end
7777
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat") do
7878
it { should be_file }
7979
it { should be_owned_by username }
80-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
80+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
8181
should be_mode 640
8282
}
8383
end
8484
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments.concat.out") do
8585
it { should be_file }
8686
it { should be_owned_by username }
87-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
87+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
8888
should be_mode 640
8989
}
9090
end
@@ -124,8 +124,8 @@
124124
describe file("#{basedir}/file") do
125125
it { should be_file }
126126
it { should be_owned_by username }
127-
it { should be_grouped_into groupname }
128-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
127+
it("should be group", :unless => (fact('osfamily') == 'windows')) { should be_grouped_into groupname }
128+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
129129
should be_mode 644
130130
}
131131
it { should contain '1' }
@@ -134,14 +134,14 @@
134134
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/01_1") do
135135
it { should be_file }
136136
it { should be_owned_by username }
137-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
137+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
138138
should be_mode 640
139139
}
140140
end
141141
describe file("#{vardir}/concat/#{safe_basedir}_file/fragments/02_2") do
142142
it { should be_file }
143143
it { should be_owned_by username }
144-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
144+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
145145
should be_mode 640
146146
}
147147
end
@@ -174,7 +174,7 @@
174174

175175
describe file("#{basedir}/file") do
176176
it { should be_file }
177-
it("should be mode", :unless => (fact('osfamily') == 'AIX')) {
177+
it("should be mode", :unless => (fact('osfamily') == 'AIX' or fact('osfamily') == 'windows')) {
178178
should be_mode 644
179179
}
180180
it { should contain '1' }

spec/acceptance/deprecation_warnings_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@
7373
end
7474
end
7575

76-
context 'concat::fragment ensure parameter' do
76+
context 'concat::fragment ensure parameter', :unless => fact('osfamily') == 'windows' do
7777
context 'target file exists' do
7878
before(:all) do
79-
shell("/bin/echo 'file1 contents' > #{basedir}/file1")
8079
pp = <<-EOS
8180
file { '#{basedir}':
8281
ensure => directory,
@@ -126,7 +125,7 @@
126125
end
127126
end # target file exists
128127

129-
context 'target does not exist' do
128+
context 'target does not exist', :unless => fact('osfamily') == 'windows' do
130129
pp = <<-EOS
131130
concat { '#{basedir}/file': }
132131
concat::fragment { 'foo':

spec/acceptance/replace_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
end
127127

128128
# XXX specinfra doesn't support be_linked_to on AIX
129-
describe file("#{basedir}/file"), :unless => (fact("osfamily") == "AIX") do
129+
describe file("#{basedir}/file"), :unless => (fact("osfamily") == "AIX" or fact("osfamily") == "windows") do
130130
it { should be_linked_to "#{basedir}/dangling" }
131131
end
132132

spec/spec_helper_acceptance.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
c.before :suite do
2525
# Install module and dependencies
2626
hosts.each do |host|
27+
if fact_on(host, 'osfamily') == 'windows'
28+
on host, 'powershell.exe -command "(New-Object System.Net.Webclient).DownloadString(\'https://forge.puppetlabs.com\')"'
29+
end
30+
2731
on host, "mkdir -p #{host['distmoduledir']}/concat"
2832
result = on host, "echo #{host['distmoduledir']}/concat"
2933
target = result.raw_output.chomp

spec/unit/classes/concat_setup_spec.rb

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
shared_examples 'setup' do |concatdir|
66
concatdir = '/foo' if concatdir.nil?
77

8-
let(:facts) {{ :concat_basedir => concatdir }}
8+
let(:facts) do
9+
{
10+
:concat_basedir => concatdir,
11+
:caller_module_name => 'Test',
12+
:osfamily => 'Debian',
13+
:id => 'root',
14+
}
15+
end
916

1017
it do
1118
should contain_file("#{concatdir}/bin/concatfragments.sh").with({
@@ -44,9 +51,10 @@
4451
concatdir = '/foo'
4552
let(:facts) do
4653
{
47-
:concat_basedir => concatdir,
48-
:osfamily => 'Solaris',
49-
:id => 'root',
54+
:concat_basedir => concatdir,
55+
:caller_module_name => 'Test',
56+
:osfamily => 'Solaris',
57+
:id => 'root',
5058
}
5159
end
5260

@@ -65,9 +73,10 @@
6573
concatdir = '/foo'
6674
let(:facts) do
6775
{
68-
:concat_basedir => concatdir,
69-
:osfamily => 'windows',
70-
:id => 'batman',
76+
:concat_basedir => concatdir,
77+
:caller_module_name => 'Test',
78+
:osfamily => 'windows',
79+
:id => 'batman',
7180
}
7281
end
7382

spec/unit/defines/concat_fragment_spec.rb

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
end
2525

2626
let(:title) { title }
27-
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
27+
let(:facts) do
28+
{
29+
:concat_basedir => concatdir,
30+
:id => id,
31+
:osfamily => 'Debian',
32+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
33+
}
34+
end
2835
let(:params) { params }
2936
let(:pre_condition) do
3037
"concat{ '#{p[:target]}': }"
@@ -162,7 +169,13 @@
162169

163170
context 'ensure => target and source' do
164171
let(:title) { 'motd_header' }
165-
let(:facts) {{ :concat_basedir => '/tmp' }}
172+
let(:facts) do
173+
{
174+
:concat_basedir => '/tmp',
175+
:osfamily => 'Debian',
176+
:id => 'root',
177+
}
178+
end
166179
let(:params) do
167180
{
168181
:target => '/etc/motd',
@@ -178,7 +191,13 @@
178191

179192
context 'ensure => target and content' do
180193
let(:title) { 'motd_header' }
181-
let(:facts) {{ :concat_basedir => '/tmp' }}
194+
let(:facts) do
195+
{
196+
:concat_basedir => '/tmp',
197+
:osfamily => 'Debian',
198+
:id => 'root',
199+
}
200+
end
182201
let(:params) do
183202
{
184203
:target => '/etc/motd',
@@ -194,7 +213,13 @@
194213

195214
context 'source and content' do
196215
let(:title) { 'motd_header' }
197-
let(:facts) {{ :concat_basedir => '/tmp' }}
216+
let(:facts) do
217+
{
218+
:concat_basedir => '/tmp',
219+
:osfamily => 'Debian',
220+
:id => 'root',
221+
}
222+
end
198223
let(:params) do
199224
{
200225
:target => '/etc/motd',

spec/unit/defines/concat_spec.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@
3333

3434
let(:title) { title }
3535
let(:params) { params }
36-
let(:facts) {{ :concat_basedir => concatdir, :id => id }}
36+
let(:facts) do
37+
{
38+
:concat_basedir => concatdir,
39+
:id => id,
40+
:osfamily => 'Debian',
41+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
42+
:kernel => 'Linux',
43+
}
44+
end
3745

3846
if p[:ensure] == 'present'
3947
it do

0 commit comments

Comments
 (0)