Skip to content

Commit 7b3411f

Browse files
ekohlevgeni
authored andcommitted
Change module feature default to capitalize
foreman_proxy::plugin::module uses $title.capitalize() and now foreman_proxy::module does too. This makes it more consistent. It also explicitly sets the feature where needed. This was explained in an issue[1]. [1]: #773 (comment)
1 parent 8f4e005 commit 7b3411f

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

manifests/module.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Boolean $enabled = false,
2424
Foreman_proxy::ListenOn $listen_on = 'https',
2525
Optional[String] $template_path = undef,
26-
String $feature = upcase($title),
26+
String $feature = $title.capitalize(),
2727
) {
2828
if $enabled {
2929
$module_enabled = $listen_on ? {

manifests/module/bmc.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
) {
1212
foreman_proxy::module { 'bmc':
1313
enabled => $enabled,
14+
feature => 'BMC',
1415
listen_on => $listen_on,
1516
}
1617
}

manifests/module/dhcp.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
) {
1212
foreman_proxy::module { 'dhcp':
1313
enabled => $enabled,
14+
feature => 'DHCP',
1415
listen_on => $listen_on,
1516
}
1617
}

manifests/module/dns.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
) {
1212
foreman_proxy::module { 'dns':
1313
enabled => $enabled,
14+
feature => 'DNS',
1415
listen_on => $listen_on,
1516
}
1617
}

manifests/module/tftp.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
foreman_proxy::module { 'tftp':
2121
enabled => $enabled,
22+
feature => 'TFTP',
2223
listen_on => $listen_on,
2324
}
2425
}

spec/defines/foreman_proxy_module_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
context 'with defaults' do
1111
it { is_expected.to compile.with_all_deps }
1212
it { is_expected.to contain_foreman_proxy__settings_file('test').with_module_enabled('false') }
13-
it { is_expected.not_to contain_foreman_proxy__feature('TEST') }
13+
it { is_expected.not_to contain_foreman_proxy__feature('Test') }
1414
end
1515

1616
context 'with enabled => true' do
1717
let(:params) { { enabled: true } }
1818

1919
it { is_expected.to compile.with_all_deps }
2020
it { is_expected.to contain_foreman_proxy__settings_file('test').with_module_enabled('https') }
21-
it { is_expected.to contain_foreman_proxy__feature('TEST') }
21+
it { is_expected.to contain_foreman_proxy__feature('Test') }
2222

2323
context 'with listen_on => both' do
2424
let(:params) { super().merge(listen_on: 'both') }
@@ -36,16 +36,16 @@
3636
end
3737

3838
context 'with feature' do
39-
let(:params) { { feature: 'Test' } }
39+
let(:params) { { feature: 'TEST' } }
4040

4141
it { is_expected.to compile.with_all_deps }
42-
it { is_expected.not_to contain_foreman_proxy__feature('Test') }
42+
it { is_expected.not_to contain_foreman_proxy__feature('TEST') }
4343

4444
context 'with enabled => true' do
4545
let(:params) { super().merge(enabled: true) }
4646

4747
it { is_expected.to compile.with_all_deps }
48-
it { is_expected.to contain_foreman_proxy__feature('Test') }
48+
it { is_expected.to contain_foreman_proxy__feature('TEST') }
4949
end
5050
end
5151
end

0 commit comments

Comments
 (0)