Issue #1291 has been updated by Robin.

File facter-1.5.2-sortfix2.patch added

luke wrote:
> This patch can't actually be working -- 'sort_by' doesn't modify the array, 
> so you're just not sorting the list at all.
> 
> You'd need to reassign the array, something like <code>@resolves = 
> @resolves.sort_by { |a| -a.length }</code>.
> 
You're right - it was obviously working purely because it wasn't modifying the 
array at all.  And, looking into the documentation further, it would seem that 
sort_by isn't stable either (despite the claims I'd originally found).

Anyway, I located a stable sort routine for ruby 
(http://codesnippets.joyent.com/posts/show/1698), which the attached patch 
uses.  I see a fix for the domain resolution has already been checked in, but a 
stable sort may well be required for other facts.
----------------------------------------
Bug #1291: Facter is using the NIS domain name instead of DNS domain name in 
some cases
http://projects.reductivelabs.com/issues/show/1291

Author: admin
Status: Code Insufficient
Priority: Normal
Assigned to: luke
Category: library
Target version: 
Complexity: Unknown
Keywords: 


It looks like the code around:

* http://reductivelabs.com/cgi-bin/facter.cgi/browser/trunk/lib/facter.rb#L692

is looking for the DNS domain name, however that line invokes the "domainname" 
command, which at least the Debian GNU/Linux and AIX man pages make clear 
returns the NIS domain name (the Solaris man page is convoluted but seems to 
say that as well). 

In any case, at my site we have a historical NIS domainname that is totally 
different from our DNS domainname, so this makes things confusing. There are 
also cases where this would just break things (e.g. we have box.foo.com and 
box.bar.com both in the NIS domain baz.com, so the first puppetized machine 
would get a SSL cert for box.baz.com, and the second one would have problems)

On Debian there is the dnsdomainname command, however the only thing I've found 
that works consistantly on all of my site's myriad operating system/version 
combinations is to do a double lookup (e.g. get the host's IP address, and then 
perform a lookup of that IP address); that way at least you'll get whatever 
nsswitch.conf or equivalent thinks your IP address resolves to, which is usualy 
what you'll be using when doing any debugging, and which is usually also 
resolvable by the other machines on the network. 


----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to