diff options
author | Markus Roberts <Markus@reality.com> | 2009-10-08 14:36:20 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-10-23 15:52:22 +1100 |
commit | fbdded7647b1b625b5d695ea85b706298924f259 (patch) | |
tree | e02d12d28534321af7c6fb91bb8932fc406c930a /lib/puppet/provider | |
parent | 4d9f76ad2653542e53a8020be9eeadb8f354837c (diff) | |
download | puppet-fbdded7647b1b625b5d695ea85b706298924f259.tar.gz puppet-fbdded7647b1b625b5d695ea85b706298924f259.tar.xz puppet-fbdded7647b1b625b5d695ea85b706298924f259.zip |
Ticket #2685 (Type error in ssh_authorized_keys)
In post processing a Symbol was being passed to StringScanner.
StringScanner was not happy with this. The error message lost
backtrace information and the test coverage was both inadequate
and broken (see #2745).
To be fully effective, this patch needs/assumes the patch for
Signed-off-by: Markus Roberts <Markus@reality.com>
Diffstat (limited to 'lib/puppet/provider')
-rw-r--r-- | lib/puppet/provider/ssh_authorized_key/parsed.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/puppet/provider/ssh_authorized_key/parsed.rb b/lib/puppet/provider/ssh_authorized_key/parsed.rb index 28a68b364..69eec9fde 100644 --- a/lib/puppet/provider/ssh_authorized_key/parsed.rb +++ b/lib/puppet/provider/ssh_authorized_key/parsed.rb @@ -15,19 +15,13 @@ Puppet::Type.type(:ssh_authorized_key).provide(:parsed, :optional => %w{options}, :rts => /^\s+/, :match => /^(?:(.+) )?(ssh-dss|ssh-rsa) ([^ ]+)(?: (.+))?$/, - :post_parse => proc { |record| - if record[:options].nil? - record[:options] = [:absent] - else - record[:options] = Puppet::Type::Ssh_authorized_key::ProviderParsed.parse_options(record[:options]) - end + :post_parse => proc { |h| + h[:options] ||= [:absent] + h[:options] = Puppet::Type::Ssh_authorized_key::ProviderParsed.parse_options(h[:options]) if h[:options].is_a? String }, - :pre_gen => proc { |record| - if record[:options].include?(:absent) - record[:options] = "" - else - record[:options] = record[:options].join(',') - end + :pre_gen => proc { |h| + h[:options] = [] if h[:options].include?(:absent) + h[:options] = h[:options].join(',') } record_line :key_v1, |