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

Unified Diff: modules/adblockplus/lib/puppet/parser/functions/ensure_symlink_state.rb

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
Index: modules/adblockplus/lib/puppet/parser/functions/ensure_symlink_state.rb
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/adblockplus/lib/puppet/parser/functions/ensure_symlink_state.rb
@@ -0,0 +1,13 @@
+# coding: utf-8
+# vi: set fenc=utf-8 ft=ruby ts=8 sw=2 sts=2 et:
+module Puppet::Parser::Functions
+
+ newfunction(:ensure_symlink_state, :type => :rvalue, :doc => <<-'begin') do |args|
+ Returns "link" if ensure_state() for the given parameter evaluates to
+ true, return "absent" otherwise.
+ begin
+ result = function_ensure_state(args) ? 'link' : 'absent'
+ return result
+ end
+
+end
« no previous file with comments | « modules/adblockplus/lib/puppet/parser/functions/ensure_state.rb ('k') | modules/adblockplus/manifests/host.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld