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