aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-22 14:29:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-22 14:29:39 -0700
commit2cafe2e1273f41801471edfd3d0a4da523846421 (patch)
tree6528700b23cb44d4bfd082e35a040435b7b3108a
parent7ce5dcdcf751cdef990b933e7ee6347775e8f503 (diff)
downloadconsfigurator-2cafe2e1273f41801471edfd3d0a4da523846421.tar.gz
fix :SSH CONNECTION-RUN
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection.lisp6
-rw-r--r--src/connection/ssh.lisp4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/connection.lisp b/src/connection.lisp
index b593999..3d09124 100644
--- a/src/connection.lisp
+++ b/src/connection.lisp
@@ -71,9 +71,9 @@ be emptied into the shell command's stdin.
Implementations can specialise on both the CONNECTION and INPUT arguments, if
they need to handle streams and strings differently.
-Returns (values OUT EXIT) where OUT is merged stdout and stderr and EXIT is
-the exit code. Should not signal any error condition just because EXIT is
-non-zero."))
+Returns (values OUT EXIT) where OUT is either merged stdout and stderr or
+stderr followed by stdout, and EXIT is the exit code. Should not signal any
+error condition just because EXIT is non-zero."))
(defmethod connection-run :around ((connection connection) cmd &optional input)
(declare (ignore cmd input))
diff --git a/src/connection/ssh.lisp b/src/connection/ssh.lisp
index 21b40b8..be5afa6 100644
--- a/src/connection/ssh.lisp
+++ b/src/connection/ssh.lisp
@@ -51,7 +51,9 @@
(if (cdr args) (escape-sh-command args) (car args)))))))
(defmethod connection-run ((c ssh-connection) cmd &optional input)
- (run :input input (sshcmd c cmd)))
+ (multiple-value-bind (out err exit)
+ (run :input input (sshcmd c cmd))
+ (values (strcat err out) exit)))
(defmethod connection-readfile ((c ssh-connection) path)
(multiple-value-bind (output error-code)