dimanche 12 février 2017

How to detect when a command fails?

I have a method that run salt command.

def test
  ........
  ........
  return_string = `salt #{id} "#{cmd_mode}" "#{command}"#{async}`
end

How to know if this command fail to run? If this command fails to run i need to do some certain operation like abort,retry, etc.

Aucun commentaire:

Enregistrer un commentaire