Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit b3c72a4

Browse files
committed
(maint) Fix mock stubs
This didn't work the way I expected it to at all. I've added an explicit requirement for puppetlabs-stdlib so I can use the capitalize() function when changing the mock settings instead.
1 parent 04f1a1c commit b3c72a4

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

Modulefile

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ project_page 'https://github.com/Whopper92/puppetlabs-rpmbuilder'
1111
dependency 'stahnma/epel', '>= 0.0.1'
1212
dependency 'stahnma/puppetlabs_yum', '>= 0.1.0'
1313
dependency 'puppetlabs/inifile', '>= 1.0.0'
14+
dependency 'puppetlabs/stdlib', '>= 3.0.0'

manifests/mock/cleanup.pp

+2-18
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,19 @@
33
$on_failure = true,
44
) {
55

6-
7-
# Python is awesome, in that it's true and false boolean
8-
# values are Camel-cased: True and False. Subsequently,
9-
# any values you pass in to a boolean configuration options
10-
# must respect the aforementioned camel-casing. Might be worth
11-
# adding a camel method for strings into stdlib?
12-
$failure = $on_failure ? {
13-
/(?i:false)/ => 'False',
14-
/(?i:true)/ => 'True',
15-
}
16-
17-
$success = $on_success ? {
18-
/(?i:false)/ => 'False',
19-
/(?i:true)/ => 'True',
20-
}
21-
226
ini_setting { "Cleanup on success":
237
ensure => present,
248
path => '/etc/mock/site-defaults.cfg',
259
section => '',
2610
setting => "config_opts['cleanup_on_success']",
27-
value => $cleanup_on_success,
11+
value => capitalize("$on_success"),
2812
}
2913

3014
ini_setting { "Cleanup on failure":
3115
ensure => present,
3216
path => '/etc/mock/site-defaults.cfg',
3317
section => '',
3418
setting => "config_opts['cleanup_on_failure']",
35-
value => $cleanup_on_failure,
19+
value => capitalize("$on_failure"),
3620
}
3721
}

0 commit comments

Comments
 (0)