Skip to content

Commit 3782afd

Browse files
author
Morgan Haskel
committed
Merge pull request #852 from richm/bug/modules-1332
(#MODULES-1332) set osfamily default for wsgi_socket_prefix
2 parents 452a012 + 8d09ecd commit 3782afd

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

manifests/mod/wsgi.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class apache::mod::wsgi (
2-
$wsgi_socket_prefix = undef,
2+
$wsgi_socket_prefix = $::apache::params::wsgi_socket_prefix,
33
$wsgi_python_path = undef,
44
$wsgi_python_home = undef,
55
){

manifests/params.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
$fastcgi_lib_path = undef
9494
$mime_support_package = 'mailcap'
9595
$mime_types_config = '/etc/mime.types'
96+
if $::osfamily == "RedHat" {
97+
$wsgi_socket_prefix = '/var/run/wsgi'
98+
} else {
99+
$wsgi_socket_prefix = undef
100+
}
96101
} elsif $::osfamily == 'Debian' {
97102
$user = 'www-data'
98103
$group = 'www-data'
@@ -194,6 +199,7 @@
194199
}
195200
}
196201
}
202+
$wsgi_socket_prefix = undef
197203
} elsif $::osfamily == 'FreeBSD' {
198204
$user = 'www'
199205
$group = 'www'
@@ -255,6 +261,7 @@
255261
$fastcgi_lib_path = undef # TODO: revisit
256262
$mime_support_package = 'misc/mime-support'
257263
$mime_types_config = '/usr/local/etc/mime.types'
264+
$wsgi_socket_prefix = undef
258265
} else {
259266
fail("Class['apache::params']: Unsupported osfamily: ${::osfamily}")
260267
}

spec/classes/mod/wsgi_spec.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
}
1919
end
2020
it { is_expected.to contain_class("apache::params") }
21-
it { is_expected.to contain_apache__mod('wsgi') }
21+
it { is_expected.to contain_class('apache::mod::wsgi').with(
22+
'wsgi_socket_prefix' => nil
23+
)
24+
}
2225
it { is_expected.to contain_package("libapache2-mod-wsgi") }
2326
end
2427
context "on a RedHat OS" do
@@ -34,7 +37,10 @@
3437
}
3538
end
3639
it { is_expected.to contain_class("apache::params") }
37-
it { is_expected.to contain_apache__mod('wsgi') }
40+
it { is_expected.to contain_class('apache::mod::wsgi').with(
41+
'wsgi_socket_prefix' => '/var/run/wsgi'
42+
)
43+
}
3844
it { is_expected.to contain_package("mod_wsgi") }
3945

4046
describe "with custom WSGISocketPrefix" do
@@ -63,7 +69,10 @@
6369
}
6470
end
6571
it { is_expected.to contain_class("apache::params") }
66-
it { is_expected.to contain_apache__mod('wsgi') }
72+
it { is_expected.to contain_class('apache::mod::wsgi').with(
73+
'wsgi_socket_prefix' => nil
74+
)
75+
}
6776
it { is_expected.to contain_package("www/mod_wsgi") }
6877
end
6978
end

0 commit comments

Comments
 (0)