- From: Daniel DeLeo <
>
- To: "Jason J. W. Williams" <
>
- Cc: Benjamin Black <
>, "
" <
>
- Subject: [[chef-dev]] Re: [[chef-dev]] Re: [[chef-dev]] Modifying the solaris2 Ohai plugin.
- Date: Wed, 20 Jul 2011 21:27:15 -0700
On Wednesday, July 20, 2011 at 9:21 PM, Jason J. W. Williams wrote:
>
Yeah it is. I added the following to plugin/platform.rb:
>
>
puts "#{os}::platform"
>
>
It printed the following when running ohai:
>
>
solaris2::platform
>
>
Did that to make sure the 'require_plugin "{os}::platform"' line was
>
loading the right plugin.
>
>
-J
>
Can you run it with -l debug and post the output? There should be a
stacktrace in there somewhere.
FWIW, ohai basically never fails, it rescues every error and silently
continues, only showing the error when running with debug logging.
--
Dan DeLeo
>
Sent via iPhone
>
>
Is your email Premiere?
>
>
On Jul 20, 2011, at 22:15, Benjamin Black
>
<
>
>
(mailto:
)>
>
wrote:
>
>
> is it even identifying the system as solaris2? if not, it wont run that
>
> plugin.
>
>
>
> b
>
>
>
> On Jul 20, 2011, at 9:11 PM, "Jason J. W. Williams"
>
> <
>
>
>
> (mailto:
)>
>
> wrote:
>
>
>
> > Actually I have put puts in both plugins/platform.rb and
>
> > plugins/solaris2/platform.rb. The latter (stock from opscode except for
>
> > the puts statement) never gets hit. Which also explains why ohai
>
> > doesn't traceback when run on OpenIndiana (it should in its current
>
> > form because OI uses GNU uname which doesn't support the -X option the
>
> > defacto solaris2 plugin uses).
>
> >
>
> > -J
>
> >
>
> > Sent via iPhone
>
> >
>
> > Is your email Premiere?
>
> >
>
> > On Jul 20, 2011, at 21:58, Daniel DeLeo
>
> > <
>
> >
>
> > (mailto:
)>
>
> > wrote:
>
> >
>
> > > On Wednesday, July 20, 2011 at 7:55 PM, Jason J. W. Williams wrote:
>
> > > > I'm trying to modify the platform.rb module of the Ohai Solaris2
>
> > > > plugin in order to extend it to detect the various distributions of
>
> > > > Solaris (Solaris/Solaris Express, OpenIndiana, Nexenta, etc.).
>
> > > > However, if I modify the file:
>
> > > >
>
> > > > /usr/lib/ruby/gems/1.9.1/gems/ohai-0.6.4/lib/ohai/plugins/solaris2/platform.rb
>
> > > >
>
> > > > ...my changes don't seem to take effect. I've even tried adding:
>
> > > > platform "test123"
>
> > > >
>
> > > > However the platform still indicates "solaris2" when I run Ohai.
>
> > > > This
>
> > > > appears to be from the line:
>
> > > >
>
> > > > platform os unless attribute?("platform")
>
> > > I think you're getting confused by if/unless here:
>
> > >
>
> > > platform os unless attribute?("platform")
>
> > > platform os if (not (attribute?("platform"))
>
> > > platform os if (not ( false ) )
>
> > > platform os if ( true )
>
> > > platform os
>
> > >
>
> > > >
>
> > > > in
>
> > > > /usr/lib/ruby/gems/1.9.1/gems/ohai-0.6.4/lib/ohai/plugins/platform.rb,
>
> > > > because attribute?("platform") is evaluating to false. It appears
>
> > > > that
>
> > > > Ohai isn't running platform.rb in the solaris2 plugin at all. Any
>
> > > > pointers are greatly appreciated.
>
> > > >
>
> > > > -J
>
> > > Not sure how else to help except for some general tips:
>
> > >
>
> > > * don't be afraid of "printf debugging". Add puts statements
>
> > > everywhere.
>
> > > * for structured data, require 'pp' and then use pp for your printf
>
> > > debugging
>
> > > * try it running ohai from the command line if you're not already
>
> > >
>
> > > Good luck
>
> > >
>
> > > --
>
> > > Dan DeLeo
Archive powered by MHonArc 2.6.16.