salt.runners.jobs.exit_success return True instead of False

43 views
Skip to first unread message

Rémy Jestin

unread,
Mar 7, 2017, 6:28:55 AM3/7/17
to Salt-users
Hi,

I've got the following state which failed :

cmd.run:
  salt
.function:
   
- tgt: 'kalamon'
   
- arg:
     
- echo "tyty" > /titi/toto

salt-run state.orchestrate orchestrate

retcode:
    1
perle-minion_master:
----------
          ID: cmd.run
    Function: salt.function
      Result: False
     Comment: Running function cmd.run failed on minions: kalamon Function cmd.run ran on kalamon.
     Started: 12:15:53.531945
    Duration: 236.852 ms
     Changes:
              kalamon:
                  /bin/sh: /titi/toto: No such file or directory

Summary for perle-minion_master
------------
Succeeded: 0 (changed=1)
Failed:    1
------------
Total states run:     1
Total run time: 236.852 ms

I get the jid with :

salt-run jobs.list_jobs

salt-run jobs.last_run

20170307121553628807:
    ----------
    Arguments:
        - echo "tyty" > /titi/toto
    Function:
        cmd.run
    Minions:
        - kalamon
    Result:
        ----------
        kalamon:
            ----------
            return:
                /bin/sh: /titi/toto: No such file or directory
    StartTime:
        2017, Mar 07 12:15:53.628807
    Target:
        kalamon
    Target-type:
        glob
    User:
        rundeck

The job failed, but the exit_success function return True :

salt-run jobs.exit_success 20170307121553628807

kalamon
:
   
True

salt-run jobs.list_job 20170307121553628807

Arguments:
    - echo "tyty" > /titi/toto
Function:
    cmd.run
Minions:
    - kalamon
Result:
    ----------
    kalamon:
        ----------
        return:
            /bin/sh: /titi/toto: No such file or directory
StartTime:
    2017, Mar 07 12:15:53.628807
Target:
    kalamon
Target-type:
    glob
User:
    rundeck
jid:
    20170307121553628807


salt-run lookup_jid 20170307121553628807

kalamon
:
   
/bin/sh: /titi/toto: No such file or directory

I don't know how to get the information that the job failed.

Thanks,

Rémy

Rémy Jestin

unread,
Mar 7, 2017, 8:31:40 AM3/7/17
to Salt-users
Precisions : 
salt-master 2016.11.2 (Carbon)
fix 35165, salt-run jobs.exit_success jid is broken : https://github.com/saltstack/salt/commit/4dcce18d01f8888d8f7f66961ec96ee44c3feca3

Rémy
Reply all
Reply to author
Forward
0 new messages