salt-ssh failed, but exit status is 0: Bug or feature?

26 views
Skip to first unread message

Thomas Güttler

unread,
Sep 23, 2019, 8:41:16 AM9/23/19
to Salt-users
salt # salt-ssh remote-host state.sls foo.bar pillar='{...}'
remote-host:
    - Specified SLS bar.foo.blu in saltenv base is not available on the salt master or through a configured fileserver


salt:/srv # echo $?
0


salt:/srv # salt-ssh --version
salt-ssh 2019.2.0 (Fluorine)


This makes calling salt-ssh from python or shell difficult since you can't rely on the exit code.

Is this a bug or a feature?

Thomas Güttler

unread,
Sep 27, 2019, 4:05:19 AM9/27/19
to Salt-users
No reply to below question.

What could be the reason?

Few people reads this group.

Few people uses salt-ssh. All people use salt with client+server.

My question is very strange. Nobody understand what I talk about.

I don't know.

The wrong exit code makes salt-ssh unreliable for Continuous Integration. The
exit code suggest everything is alright, but it isn't.

I feel lonely here.

Regards,
 Thomas Güttler

Phipps, Thomas

unread,
Sep 27, 2019, 5:30:07 PM9/27/19
to salt-...@googlegroups.com
The issue is not that salt-ssh failed. It worked perfectly fine. it is the function you tried to run that failed. 

the exit code useful to know if salt-ssh wasn't able to connect to the endpoint of it It through an actual error. which in this case it didn't it connected ran the command and returned the result. The result is what had a failure. and if you were scripting salt-ssh you would use --out=json to create a json object that you could check for the state failure. if the exit code was anything but 0 you would know the failure was in salt-ssh, but because salt-ssh returned 0 you know the failure is in the command that ran. 

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/63c6c966-c74e-4064-a1a5-27ddbb2b243d%40googlegroups.com.

Max Arnold

unread,
Sep 28, 2019, 5:02:31 AM9/28/19
to Salt-users
Looks like a bug/regression. You could try to ping @marmarek on Github, who submitted a PR in Salt Fluorine to fix this issue: https://github.com/saltstack/salt/issues/50727 https://github.com/saltstack/salt/pull/50733

Thomas Güttler

unread,
Sep 30, 2019, 4:35:59 AM9/30/19
to Salt-users
thank you for your answers.

Reply all
Reply to author
Forward
0 new messages