Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/puppet.pp

Issue 29370632: NoIssue - Refactor ensure_*state functions (Closed)
Patch Set: Created Jan. 3, 2017, 2:25 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/adblockplus/manifests/host.pp ('k') | modules/adblockplus/manifests/puppet/agent.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/puppet.pp
===================================================================
--- a/modules/adblockplus/manifests/puppet.pp
+++ b/modules/adblockplus/manifests/puppet.pp
@@ -21,18 +21,9 @@
# https://forge.puppet.com/puppetlabs/stdlib
include stdlib
- if $ensure !~ /^(absent|purged)$/ {
- $ensure_directory = 'directory'
- $ensure_file = 'file'
- }
- else {
- $ensure_directory = 'absent'
- $ensure_file = 'absent'
- }
-
# https://tickets.puppetlabs.com/browse/PUP-3655
ensure_resource('file', '/var/lib/puppet/facts.d', {
- ensure => $ensure_directory,
+ ensure => ensure_directory_state($ensure),
group => 'root',
mode => 0755,
owner => 'root',
@@ -41,7 +32,7 @@
# http://stackoverflow.com/questions/22816946/
ensure_resource('file', '/var/lib/puppet/facts.d/pup3665', {
'content' => "#!/bin/sh\necho 'pup3665=workaround'\n\n",
- 'ensure' => $ensure_file,
+ 'ensure' => ensure_file_state($ensure),
'group' => 'root',
'mode' => 0755,
'owner' => 'root',
« no previous file with comments | « modules/adblockplus/manifests/host.pp ('k') | modules/adblockplus/manifests/puppet/agent.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld