On Wed, Sep 15, 2010 at 12:25 PM, Darren Chamberlain <dar...@boston.com> wrote:
> * Nan Liu <nan at puppetlabs.com> [2010/09/15 12:08]:
>> Check some hard coded path, and tries to detect if it's available in $PATH
>> using which:
>>
>> case
>> when File.executable?("/opt/NSBglassfish/bin/asadmin")
>>   commands :asadmin => "/opt/NSBglassfish/bin/asadmin"
>> when File.executable?("/usr/local/NSBglassfish/bin/asadmin")
>>   commands :asadmin => "/usr/local/NSBglassfish/bin/asadmin"
>> else
>>   asadmin_path = `which asadmin`
>>   if $?.exitstatus ==0
>>     commands :asadmin => asadmin_path
>
> I have no comment on the general approach, but just wanted to point
> out that checking $? doesn't necessarily work everywhere:
>
>  $ uname -a ; which asdf ; echo $?
>  SunOS smacky 5.10 Generic_142900-03 sun4v sparc SUNW,Sun-Fire-T200 Solaris
>  no asdf in /usr/local/bin /usr/ccs/bin /usr/bin /bin
>  0
>
> I've been bitten by this several times (though never in puppet).

Does 'type --all asdf' do the right thing on SunOS ?

>
> --
> The Net views censorship as a network failure, and routes around it.
>    -- John Gilmore
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
>



-- 
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to