On Tue, May 21, 2013 at 3:03 PM, Wil Cooley <wcoo...@nakedape.cc> wrote:

> On Tue, May 21, 2013 at 9:53 AM, Charlie Sharpsteen
> <ch...@puppetlabs.com> wrote:
>
> > Could you provide a bit more information on what the entry in your
> /etc/hosts file looked like? It would be interesting to reproduce this
> behavior and see if everything is functioning as intended.
>
>
> Sure; in my /etc/hosts I had the following for my host-only vbox net:
>
> 192.168.56.1   coolair.local coolair
>
> With that in place:
>
> $ time ruby -rsocket -e "Socket.gethostbyname(Socket.gethostname)"
> real 0m10.013s
>
> And when I change it to:
>
> 192.168.56.1 coolair
>
> I get:
>
> $ time ruby -rsocket -e "Socket.gethostbyname(Socket.gethostname)"
> real 0m0.032s
>
> After a little tracing, it looks like it's the result of loading
> webrick in puppet/util/monkey_patches.rb:
>
> /Library/Ruby/Site/1.8/puppet/util/monkey_patches.rb:419::-: require
> 'webrick'
>
> Which was added in ec462b7b: (#18781) Be more tolerant of old clients
> in WEBrick server
>
> Since this is just twiddling a constant (does that count as
> monkey-patching?), wouldn't this maybe be better done in
> lib/puppet/network/http/webrick.rb? If I understand it correctly,
> these monkey-patches get applied for every invocation of puppet, even
> if it's just "puppet --version", so it seems like it should be as
> minimal as possible.
>

I agree this should be restricted to code paths that actually use webrick


> For that matter, the two previous sections that monkey-patch openssl
> seem like they would be better off elsewhere; for example, the section
> "if Puppet::Util::Platform.windows?" that starts on line 398 seems
> like it might be better off somewhere in lib/puppet/util/windows*.
>

In the case of the windows-specific monkey patches for openssl, there is no
difference putting them in lib/puppet/util/monkey_patches.rb or
lib/puppet/util/windows.rb, as both are always loaded via require 'puppet'.

The reason for not moving them to the puppet's http client code, e.g.
lib/puppet/network/http/connection.rb, is because not all modules use
puppet's http client for making connections. For example, the module tool
uses open-uri, as do other providers. With that said, we could move the
code to only load the root certs if we're going to launch an application,
and do so before we invoke the application.


> (Sorry to gripe w/o a patch; I haven't a Windows system to test on nor
> do I know if I have a working setup for running the Puppet unit
> tests.)
>
> Wil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-dev+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-dev@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
Josh

-- 
Josh Cooper
Developer, Puppet Labs

*Join us at PuppetConf 2013, August 22-23 in San Francisco - *
http://bit.ly/pupconf13*
**Register now and take advantage of the Early Bird discount - save 25%!*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to