FAQ
I'd like to run a remote command and get the return code to determine the
success of the command. Currently it only returns any printed output. Is
there a way to get the return code as well?

-Ram

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Tim O'Guin at Dec 10, 2014 at 3:02 pm
    Hey Ram,

    Try using `cmd.run_all` instead. That will return a dict of the stdout,
    stderr, pid, and retcode, whereas `cmd.run` will only return the stdout.
    On Wed, Dec 10, 2014 at 7:49 AM, Raghuram BK wrote:

    I'd like to run a remote command and get the return code to determine the
    success of the command. Currently it only returns any printed output. Is
    there a way to get the return code as well?

    -Ram

    --
    You received this message because you are subscribed to the Google Groups
    "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Colton Myers at Jan 5, 2015 at 11:26 pm
    I know this is an old-ish thread, but I wanted to point out that there are also commands for only returning the retcode, or only returning the STDERR or STDOUT, etc. If you look through the documentation for that module, I think you'll find what you're looking for.

    --
    Colton Myers
    Platform Engineer, SaltStack
    @basepi on Github/Twitter/IRC
    On Dec 10, 2014, at 6:49 AM, Raghuram BK wrote:

    I'd like to run a remote command and get the return code to determine the success of the command. Currently it only returns any printed output. Is there a way to get the return code as well?

    -Ram

    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedDec 10, '14 at 1:49p
activeJan 5, '15 at 11:26p
posts3
users3

People

Translate

site design / logo © 2022 Grokbase