Hi. I''m running facter 1.5.1 in Ubuntu Jaunty. facter is giving me inconsistent results for the operatingsystem fact: $ facter operatingsystem Debian $ facter | grep operatingsystem operatingsystem => Ubuntu operatingsystemrelease => 9.04 Is this a known problem? Possibly fixed in a more recent release? I searched the list for it and didn''t see any reports of this. Thanks, Andrew. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Schulman <google-groups-andrex@sneakemail.com> writes:> Hi. I''m running facter 1.5.1 in Ubuntu Jaunty. facter is giving me > inconsistent results for the operatingsystem fact:> $ facter operatingsystem > Debian> $ facter | grep operatingsystem > operatingsystem => Ubuntu > operatingsystemrelease => 9.04> Is this a known problem? Possibly fixed in a more recent release? I > searched the list for it and didn''t see any reports of this.This sort of thing is a common problem with facter caused by the fact that facter doesn''t load all plugins unless you run it without options. I think there may have been some subsequent work to improve this, but I''m not sure. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Nov 12, 2009 at 11:29 AM, Russ Allbery <rra@stanford.edu> wrote:> > Andrew Schulman <google-groups-andrex@sneakemail.com> writes: > > > Hi. I''m running facter 1.5.1 in Ubuntu Jaunty. facter is giving me > > inconsistent results for the operatingsystem fact: > > > $ facter operatingsystem > > Debian > > > $ facter | grep operatingsystem > > operatingsystem => Ubuntu > > operatingsystemrelease => 9.04 > > > Is this a known problem? Possibly fixed in a more recent release? I > > searched the list for it and didn''t see any reports of this. > > This sort of thing is a common problem with facter caused by the fact that > facter doesn''t load all plugins unless you run it without options. I > think there may have been some subsequent work to improve this, but I''m > not sure. >Ugh. This is particularly sucky, and I vote this fact needs to be fixed for this irrespective of the plugin loading issue. The problem is: if Facter.value(:lsbdistid) == "Ubuntu" "Ubuntu" elsif FileTest.exists?("/etc/debian_version") "Debian" the first invocation doesn''t fill lsbdistid, so it falls through to Debian when /etc/debian_version exists on Ubuntu.> > -- > Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/> > > > >-- nigel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nigel Kersten <nigelk@google.com> writes:> Ugh. This is particularly sucky, and I vote this fact needs to be fixed > for this irrespective of the plugin loading issue.> The problem is:> if Facter.value(:lsbdistid) == "Ubuntu" > "Ubuntu" > elsif FileTest.exists?("/etc/debian_version") > "Debian"> the first invocation doesn''t fill lsbdistid, so it falls through to > Debian when /etc/debian_version exists on Ubuntu.Inside Puppet, this works fine, since Puppet always loads all plugins. It really only affects the command-line invocation (although I don''t know what happens if you use facter in a different Ruby program). -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Nov 12, 2009 at 2:36 PM, Russ Allbery <rra@stanford.edu> wrote:> > Nigel Kersten <nigelk@google.com> writes: > > > Ugh. This is particularly sucky, and I vote this fact needs to be fixed > > for this irrespective of the plugin loading issue. > > > The problem is: > > > if Facter.value(:lsbdistid) == "Ubuntu" > > "Ubuntu" > > elsif FileTest.exists?("/etc/debian_version") > > "Debian" > > > the first invocation doesn''t fill lsbdistid, so it falls through to > > Debian when /etc/debian_version exists on Ubuntu. > > Inside Puppet, this works fine, since Puppet always loads all plugins. It > really only affects the command-line invocation (although I don''t know > what happens if you use facter in a different Ruby program). > >This looks like more of a result of using grep. If you call facter with operatingsystem, you are asking for just the operating system. If you call facter without any arguments, it gives you everything, then you are grepping for anything that contains the continuous stream of letters "operatingsystem", whether or not it is a separate word or not. That would happen with any program, facter or not. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Nov 12, 2009 at 4:48 PM, lance dillon <riffraff000@gmail.com> wrote:> > > On Thu, Nov 12, 2009 at 2:36 PM, Russ Allbery <rra@stanford.edu> wrote: > >> >> Nigel Kersten <nigelk@google.com> writes: >> >> > Ugh. This is particularly sucky, and I vote this fact needs to be fixed >> > for this irrespective of the plugin loading issue. >> >> > The problem is: >> >> > if Facter.value(:lsbdistid) == "Ubuntu" >> > "Ubuntu" >> > elsif FileTest.exists?("/etc/debian_version") >> > "Debian" >> >> > the first invocation doesn''t fill lsbdistid, so it falls through to >> > Debian when /etc/debian_version exists on Ubuntu. >> >> Inside Puppet, this works fine, since Puppet always loads all plugins. It >> really only affects the command-line invocation (although I don''t know >> what happens if you use facter in a different Ruby program). >> >> > This looks like more of a result of using grep. > > If you call facter with operatingsystem, you are asking for just the > operating system. If you call facter without any arguments, it gives you > everything, then you are grepping for anything that contains the continuous > stream of letters "operatingsystem", whether or not it is a separate word or > not. That would happen with any program, facter or not. >This has nothing to do with grep. facter should report a single consistent value for ''operatingsystem'' when invoked in either of these ways. It''s certainly related to the bigger facter issue of not loading all facts when you simply ask for one, but the fact (no pun intended) stands that this should be fixed regardless of the state of that issue. Andrew, have you put a bug report in about this?> > > >-- nigel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
> This has nothing to do with grep. > > facter should report a single consistent value for ''operatingsystem'' when > invoked in either of these ways.Agreed.> Andrew, have you put a bug report in about this?No, I wanted to check first if I was missing something. I''ll file a bug report about it. And, it does occur within puppet-- that''s how I noticed it. I have case $operatingsystem { debian: { $diffutils = [''diffutils'', ''diffutils-doc''] } ubuntu: { $diffutils = [''diff'', ''diff-doc''] } } and found that I was getting diffutils (the debian case) on Ubuntu. Thanks, Andrew. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andrew Schulman wrote:>> This has nothing to do with grep. >> >> facter should report a single consistent value for ''operatingsystem'' when >> invoked in either of these ways. >Maybe I am jumping in too late but do you have lsb installed on that host (lsb-base package from memory I think)? Because if you don''t then Facter won''t return Ubuntu. Not that we shouldn''t refactor that fact but unfortunately Ubuntu is not an easy system to identify unlike some others. https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/19353 http://www.debianadmin.com/find-your-debian-or-ubuntu-linux-version-you-are-running.html Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBSvzbbSFa/lDkFHAyAQKTegf/XWD9Hz6MJ31adRiVqH9+sMle1+9tJGHT b1PrYuafDi+OUXQDMMKksWnxZXx1S63ymW+/ix44i6TU8AOl1ClsCyahL1FdKPER MP176Ls5zxv4E2F8d04EqsI/BGuT4eBpOhsvldoeWjoN/tx614qat3XSAb0R0srZ 4WJe/c9VJLgOM/HQfHN+OHJXwP7Gj1a4jLhuFy/LAEAr2hjg0np/tLVnRdziDHZg Lxl4NpzZFH30F/9LC/0v4lpgMyfNlf66tvaLt5Bc/nQa58+plroADeCmSCIvJP65 CrSh7EBzmxGeb2LamQw/HlR1K7C5JA224/1pjkwJbxAuwR2ycRH6BA==lmcP -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James Turnbull <james@lovedthanlost.net> writes:> Andrew Schulman wrote:>>> This has nothing to do with grep.>>> facter should report a single consistent value for ''operatingsystem'' when >>> invoked in either of these ways.> Maybe I am jumping in too late but do you have lsb installed on that > host (lsb-base package from memory I think)? Because if you don''t > then Facter won''t return Ubuntu.Yeah, I bet that''s more likely than my explanation, given that it''s also not working inside Puppet (which doesn''t have the plugin problem). Although that doesn''t explain why running facter with grep works.... -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Russ Allbery wrote:> > Yeah, I bet that''s more likely than my explanation, given that it''s also > not working inside Puppet (which doesn''t have the plugin problem). > Although that doesn''t explain why running facter with grep works.... >Ah missed that - weird. That and the Puppet run suggests something broader is going on. Regards James Turnbull - -- Author of: * Pro Linux System Administration (http://tinyurl.com/linuxadmin) * Pulling Strings with Puppet (http://tinyurl.com/pupbook) * Pro Nagios 2.0 (http://tinyurl.com/pronagios) * Hardening Linux (http://tinyurl.com/hardeninglinux) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEVAwUBSvzpwSFa/lDkFHAyAQIfPAf/cEA3vvbhQiQzu1CONBrpVwnrcKTELMO9 pet4PFm5pcXAxQp1ZJoQMhTa39hOj1d2CtMmtajYea3++XPLX0+uUNphGAS+iKkr eESl6vJJHCE5iq4irHaowhrwq5r3GqsktuIwTYcfOqRby+llbRfJtR1YDJVKuOKp QjfRlYwXfUaLCZsV0necG9/TzFHSR1DLW5wPJKcQONAzLPXWNfzzWWHElgHIGoZF JnNw1JoMKMkvI4x6cj+FcI17RPPbigopq0BK2MovqM+Plsln/y0d3HO2d73GX3wi 1ahueEtJ6xNK70CyEBW1MjpqXCBOA0Yx0gizmWz5f8gs3RZ0ddJOIw==QUgc -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
I do have lsb-base installed, yes. Not one I selected-- it seems to have come automatically with Jaunty. I just upgraded facter from 1.5.1 to 1.5.6, and this problem no longer occurs. Sorry-- should''ve tried that first. Thanks for everyone''s help with this. Andrew. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---