On Mon, Mar 21, 2011 at 8:23 AM, Todd Zullinger <t...@pobox.com> wrote:
> If xend is not running, xm list writes to stderr and facter propagates > this to the user. Redirect stderr to /dev/null. > --- > lib/facter/util/xendomains.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/lib/facter/util/xendomains.rb b/lib/facter/util/xendomains.rb > index 4f590a8..6b0d403 100644 > --- a/lib/facter/util/xendomains.rb > +++ b/lib/facter/util/xendomains.rb > @@ -2,7 +2,7 @@ > # > module Facter::Util::Xendomains > def self.get_domains > - if xm_list = Facter::Util::Resolution.exec('/usr/sbin/xm list') > + if xm_list = Facter::Util::Resolution.exec('/usr/sbin/xm list > 2>/dev/null') > domains = xm_list.split("\n").reject { |line| line =~ > /^(Name|Domain-0)/ } > domains.map { |line| line.split(/\s/)[0] }.join(',') > end > -- > 1.7.4.1 > +1 Assuming that there is no output on stdout in the error case, it appears that this will return nil, just as if xm had not been present. -- M ----------------------------------------------------------- When in trouble or in doubt, run in circles, scream and shout. -- 1920's parody of the maritime general prudential rule ------------------------------------------------------------ -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.