On Tue, May 21, 2013 at 9:53 AM, Charlie Sharpsteen
<[email protected]> 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.

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*.

(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 [email protected].
To post to this group, send email to [email protected].
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