diff --git a/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb b/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb index aaddddbdf1..077e188f5c 100644 --- a/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb +++ b/puppet/zulip/lib/puppet/parser/functions/zulipconf.rb @@ -9,15 +9,4 @@ module Puppet::Parser::Functions default end end - - newfunction(:zulipsecret, :type => :rvalue) do |args| - default = args.pop - joined = args.join(" ") - output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result=$?.success? - if result - output.strip() - else - default - end - end end diff --git a/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb b/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb new file mode 100644 index 0000000000..b23dc98279 --- /dev/null +++ b/puppet/zulip/lib/puppet/parser/functions/zulipsecret.rb @@ -0,0 +1,12 @@ +module Puppet::Parser::Functions + newfunction(:zulipsecret, :type => :rvalue) do |args| + default = args.pop + joined = args.join(" ") + output = `/usr/bin/crudini --get /etc/zulip/zulip-secrets.conf #{joined} 2>&1`; result=$?.success? + if result + output.strip() + else + default + end + end +end