- From: "Jason J. W. Williams" <
>
- To: Daniel DeLeo <
>
- Cc: "
" <
>
- Subject: [[chef-dev]] Re: [[chef-dev]] Modifying the solaris2 Ohai plugin.
- Date: Wed, 20 Jul 2011 22:11:27 -0600
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
<
>
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.