Skip to content

Commit 33cd25f

Browse files
author
Phil Friderici
committed
Remove support for stringified booleans
1 parent c8e9b42 commit 33cd25f

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

manifests/service.pp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@
5858
# Check https://www.puppet.com/docs/puppet/7/types/service.html#service-attribute-stop for more information.
5959
#
6060
define types::service (
61-
Stdlib::Ensure::Service $ensure = 'running',
62-
Optional[String[1]] $binary = undef,
63-
Optional[String[1]] $control = undef,
64-
Variant[Boolean, Enum['true', 'false', 'manual']] $enable = true,
65-
Optional[Variant[Boolean, Enum['true', 'false']]] $hasrestart = undef,
66-
Optional[Variant[Boolean, Enum['true', 'false']]] $hasstatus = undef,
67-
Optional[String[1]] $manifest = undef,
68-
Optional[String[1]] $path = undef,
69-
Optional[String[1]] $pattern = undef,
70-
Optional[String[1]] $provider = undef,
71-
Optional[String[1]] $restart = undef,
72-
Optional[String[1]] $start = undef,
73-
Optional[String[1]] $status = undef,
74-
Optional[String[1]] $stop = undef,
61+
Stdlib::Ensure::Service $ensure = 'running',
62+
Optional[String[1]] $binary = undef,
63+
Optional[String[1]] $control = undef,
64+
Variant[Boolean, Enum['manual']] $enable = true,
65+
Optional[Boolean] $hasrestart = undef,
66+
Optional[Boolean] $hasstatus = undef,
67+
Optional[String[1]] $manifest = undef,
68+
Optional[String[1]] $path = undef,
69+
Optional[String[1]] $pattern = undef,
70+
Optional[String[1]] $provider = undef,
71+
Optional[String[1]] $restart = undef,
72+
Optional[String[1]] $start = undef,
73+
Optional[String[1]] $status = undef,
74+
Optional[String[1]] $stop = undef,
7575
) {
7676
service { $name:
7777
ensure => $ensure,

spec/classes/init_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@
536536
services: {
537537
'service-stopped' => {
538538
'ensure' => 'stopped',
539-
'enable' => 'false',
539+
'enable' => false,
540540
},
541541
'service-running' => {
542542
'ensure' => 'running',
543-
'enable' => 'true',
543+
'enable' => true,
544544
}
545545
}
546546
}
@@ -552,7 +552,7 @@
552552
is_expected.to contain_service('service-stopped').with(
553553
{
554554
'ensure' => 'stopped',
555-
'enable' => 'false',
555+
'enable' => false,
556556
},
557557
)
558558
end
@@ -561,7 +561,7 @@
561561
is_expected.to contain_service('service-running').with(
562562
{
563563
'ensure' => 'running',
564-
'enable' => 'true',
564+
'enable' => true,
565565
},
566566
)
567567
end

spec/defines/service_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
binary: '/bin/true',
2222
control: 'SERVICE_MAXIMUM_START',
2323
enable: 'manual',
24-
hasrestart: 'true',
25-
hasstatus: 'false',
24+
hasrestart: true,
25+
hasstatus: false,
2626
manifest: '/bin/manifest',
2727
path: '/etc/init.d',
2828
pattern: 'service_maximum',
@@ -68,7 +68,7 @@
6868
end
6969

7070
describe 'with parameter enable' do
71-
['true', true, 'false', false, 'manual'].each do |value|
71+
[true, false, 'manual'].each do |value|
7272
context "set to #{value}" do
7373
let(:title) { 'my_service' }
7474
let(:params) { { enable: value } }

0 commit comments

Comments
 (0)