Skip to content

plugin doesn't detect a non zero exit status returned from minion cmd.run function #18

Closed

Description

@zerthimon

Salt detects this well:

root@master:~# salt minion cmd.run 'true 1'
minion:
root@master:~# echo $?
0
root@master:~# salt minion cmd.run 'false 1'
minion:
ERROR: Minions returned with non-zero exit code
root@master:~# echo $?
11
root@master:~#

The plugin doesn't detect the error and continues the job.
It would rock if plugin detects this situation and fails the job (or not ? config parameter ?)

Activity

  1. mchugh19 commented on Apr 8, 2016

    @mchugh19

    Thanks for reporting. I'll get on it

  2. mchugh19 commented on Apr 11, 2016

    @mchugh19

    Hmmm. It appears this isn't exposed through the salt-api.

    Here's the output from cmd.run 'false 1':

    {
        "return": [
            {
                "web1": ""
            }
        ]
    }
    

    So first we'll need salt-api updated as mentioned in saltstack/salt/issues/18510

  3. zerthimon commented on Apr 11, 2016

    @zerthimon
    Author

    So, salt CLI command receives the exit status from minion and exits correctly, but salt-api doesn't expose it to the caller, right?

  4. mchugh19 commented on Apr 11, 2016

    @mchugh19
  5. mchugh19 commented on Jul 30, 2018

    @mchugh19

    The salt-api has been enhanced with the 2017.7 release, and this will be supported in the next release of the Jenkins plugin.

  6. zerthimon commented on Jul 30, 2018

    @zerthimon
    Author

    Hell yeah !!!

  7. mchugh19 commented on Aug 7, 2018

    @mchugh19

    This was corrected in the 3.2.0 release. It should be available within the next 24 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions