On Nov 19, 2008, at 6:50 AM, James Turnbull wrote:

>
>
> Signed-off-by: James Turnbull <[EMAIL PROTECTED]>
> ---
> CHANGELOG    |    2 ++
> bin/puppetca |   14 ++++++++++----
> 2 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/CHANGELOG b/CHANGELOG
> index 1a03dc4..591d4b1 100644
> --- a/CHANGELOG
> +++ b/CHANGELOG
> @@ -1,4 +1,6 @@
> 0.24.x
> +    Fixed #1668 - puppetca can't clean unsigned certs
> +
>     Moved RRD feature from util/metric.rb to feature/base.rb
>
>     Fixed #1735 and #1747 - Fixes to confine system
> diff --git a/bin/puppetca b/bin/puppetca
> index 84c1599..ed9d82e 100755
> --- a/bin/puppetca
> +++ b/bin/puppetca
> @@ -237,10 +237,16 @@ when :clean
>     else
>         hosts.each do |host|
>             cert = ca.getclientcert(host)[0]
> -                if cert.nil?
> -                    $stderr.puts "Could not find client certificate  
> for %s" % host
> -                    next
> -                end
> +
> +            if cert.nil?
> +                cert = ca.getclientcsr(host)
> +            end
> +
> +            if cert.nil?
> +                $stderr.puts "Could not find client certificate for  
> %s" % host
> +                next
> +            end
> +
>             ca.clean(host)
>             cleaned = true
>         end

I'd refactor this like:

unless cert = ca.getclientcert(host)[0] || ca.getclientcsr(host)
   $stderr.puts...
   next
end

I think it's the same functioanality, but much shorter and clearer.

-- 
Someday I want to be rich. Some people get so rich they lose all
respect for humanity. That's how rich I want to be. --Rita Rudner
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to