From 0e320508328db93fc2ca8aa29eb1ed22e0f0f22a Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 12 Aug 2015 08:42:35 +0200 Subject: whitespace cleanup --- lib/puppet/parser/functions/trocla_set.rb | 10 +++++----- lib/puppet/util/trocla_helper.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/puppet/parser/functions/trocla_set.rb b/lib/puppet/parser/functions/trocla_set.rb index c3c9b49..06da5ae 100644 --- a/lib/puppet/parser/functions/trocla_set.rb +++ b/lib/puppet/parser/functions/trocla_set.rb @@ -38,21 +38,21 @@ trocla, for example via cli. if args[0].is_a?(Array) args = args[0] end - + key = args[0] value = args[1] raise(Puppet::ParseError, "You need to pass at least key & value as an argument!") if key.nil? || value.nil? - + format = args[2] || 'plain' return_format = args[3] || format options = args[4] || {} - + configfile = File.join(File.dirname(Puppet.settings[:config]), "troclarc.yaml") - + raise(Puppet::ParseError, "Trocla config file #{configfile} not readable") unless File.exist?(configfile) require 'trocla' - + result = (trocla=Trocla.new(configfile)).set_password(key,format,value) if format != return_format && (result = trocla.get_password(key,return_format)).nil? raise(Puppet::ParseError, "Plaintext password is not present, but required to return password in format #{return_format}") if (return_format == 'plain') || trocla.get_password(key,'plain').nil? diff --git a/lib/puppet/util/trocla_helper.rb b/lib/puppet/util/trocla_helper.rb index 64ef859..94670ae 100644 --- a/lib/puppet/util/trocla_helper.rb +++ b/lib/puppet/util/trocla_helper.rb @@ -16,7 +16,7 @@ module Puppet::Util::TroclaHelper key = args[0] || raise(Puppet::ParseError, "You need to pass at least a key as an argument!") format = args[1] || 'plain' options = args[2] || {} - + if options.is_a?(String) require 'yaml' options = YAML.load(options) @@ -27,7 +27,7 @@ module Puppet::Util::TroclaHelper raise(Puppet::ParseError, "Trocla config file #{configfile} is not readable") unless File.exist?(configfile) require 'trocla' - + has_options ? Trocla.new(configfile).send(trocla_func, key, format, options) : Trocla.new(configfile).send(trocla_func, key, format) end module_function :trocla -- cgit v1.2.3