[chef] Re: Re: Re: testing for mounted fs, and trying shell_out


Chronological Thread 
  • From: "Brasic, Carl" < >
  • To:
  • Subject: [chef] Re: Re: Re: testing for mounted fs, and trying shell_out
  • Date: Tue, 25 Sep 2012 17:10:56 -0500

On Tue, Sep 25, 2012 at 4:43 PM, 
< >
 wrote:
> cool... so my approach to the task using shell_out and begin/rescue is
> sane, if not good?

Seems like you're expecting shell_out to raise an exception if  the
grep command doesn't find the mount.  That's not how shell_out works,
so your rescue block will never run.
Instead you should be checking #exitstatus:

  if node['ec2']
    ebs_mounted = shell_out("grep /ebs /proc/mounts 2>&1 | grep -q
md[1-9]").exitstatus.zero?
  end

Thanks,
Carl



Archive powered by MHonArc 2.6.16.

§