Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Bail on failed SSH command with information about what failed #1501

Merged
merged 1 commit into from
Jul 21, 2015

Conversation

nathanleclaire
Copy link
Contributor

@ehazlett @bfirsh @prologic WDYT?

Closes #1266

Signed-off-by: Nathan LeClaire nathan.leclaire@gmail.com

@prologic
Copy link

We can't just test for the exit code directly?

@nathanleclaire
Copy link
Contributor Author

@prologic There's no cross platform way to do so that I am aware of (see http://stackoverflow.com/questions/10385551/get-exit-code-go, for instance).

@prologic
Copy link

Hmm I find this quite surpsingly really See Popen.returncode -- Unless the Python standard library has been lying to me this whole time!

@prologic
Copy link

Go really has no platform independent way of returning the exit status of a subprocess?

@nathanleclaire
Copy link
Contributor Author

Go really has no platform independent way of returning the exit status of a subprocess?

AFAICT not really. There are some "hack-arounds", and it's fairly easy to tell whether a process failed or succeeded, but I think the actual numeric codes are fairly platform-specific.

@prologic
Copy link

Weird but okay :)

James Mills / prologic

E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au

On Wed, Jul 15, 2015 at 11:29 AM, Nathan LeClaire notifications@github.com
wrote:

Go really has no platform independent way of returning the exit status of
a subprocess?

AFAICT not really. There are some "hack-arounds", and it's fairly easy to
tell whether a process failed or succeeded, but I think the actual numeric
codes are fairly platform-specific.


Reply to this email directly or view it on GitHub
#1501 (comment).

@bfirsh
Copy link
Contributor

bfirsh commented Jul 15, 2015

Nice!

Might be worth explaining a little clearer what's going on to make it less scary: "Machine ran a command on a host using SSH and it failed:"

Does the upstream error also explain how you might recover from this? (e.g. remove the host and try creating it again)

@nathanleclaire nathanleclaire added this to the 0.4.0 milestone Jul 21, 2015
@nathanleclaire
Copy link
Contributor Author

cc @ehazlett --- I'm not sure about this exact output format but I really want to get this in for the next release as our failing SSH commands right now and not spitting out much that's useful.

@ehazlett
Copy link
Contributor

I think we can tweak the output later. I agree it would be great to have this soon.

LGTM

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
@nathanleclaire
Copy link
Contributor Author

Pending Travis, LGTM. Should work with native and external SSH both.

@ehazlett
Copy link
Contributor

LGTM

ehazlett added a commit that referenced this pull request Jul 21, 2015
Bail on failed SSH command with information about what failed
@ehazlett ehazlett merged commit 89e6530 into docker:master Jul 21, 2015
@nathanleclaire nathanleclaire deleted the bail_on_failed_ssh branch September 23, 2015 00:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants