From bfbb6ecf855baf308ad23657c6001daccc3f98d8 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Tue, 16 Mar 2010 06:47:41 -0500 Subject: last commits before ALPHA release --- lib/puppet/provider/sudoers/parsed.rb | 10 +++++----- lib/puppet/type/sudoers.rb | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/puppet/provider/sudoers/parsed.rb b/lib/puppet/provider/sudoers/parsed.rb index e18b220..85e9fe1 100644 --- a/lib/puppet/provider/sudoers/parsed.rb +++ b/lib/puppet/provider/sudoers/parsed.rb @@ -141,16 +141,16 @@ Puppet::Type.type(:sudoers).provide( # overriding how lines are written to the file def self.to_line(hash) - puts "\nEntering self.to_line for #{hash[:name]}" - puts "\n#{hash.to_yaml}\n" + #puts "\nEntering self.to_line for #{hash[:name]}" + #puts "\n#{hash.to_yaml}\n" # # dynamically call a function based on the value of hash[:type] if(hash[:record_type] == :blank || hash[:record_type] == :comment) hash[:line] - elsif(hash[:sudo_alias]) + elsif(hash[:type] == 'alias') self.alias_to_line(hash) - elsif(hash[:commands]) + elsif(hash[:type] == 'user_spec') self.spec_to_line(hash) - elsif(hash[:parameters]) + elsif(hash[:type] == 'default') self.default_to_line(hash) else raise Puppet::Error, "dont understand how to write out record \n|#{hash.to_yaml}\n|" diff --git a/lib/puppet/type/sudoers.rb b/lib/puppet/type/sudoers.rb index 64d66e0..dcb4cfe 100644 --- a/lib/puppet/type/sudoers.rb +++ b/lib/puppet/type/sudoers.rb @@ -140,6 +140,7 @@ Defaults@host x=y,one=1,two=2 self[:type] = 'alias' checkprops(SUDOERS_DEFAULT, SUDOERS_SPEC) elsif self[:parameters] + self[:type] = 'default' checkprops(SUDOERS_ALIAS, SUDOERS_SPEC) elsif self[:users] self[:type] = 'user_spec' -- cgit v1.2.3