aboutsummaryrefslogtreecommitdiff
path: root/src/connection/ssh.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:41:07 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:41:07 -0700
commit76302017940f60286867dc083def308d3115e1e7 (patch)
treea239e60c7d868f4f7caebcbc1c9efc6a7385d995 /src/connection/ssh.lisp
parentccb72f945a35429182a3bc8d43ed5426999f81c7 (diff)
downloadconsfigurator-76302017940f60286867dc083def308d3115e1e7.tar.gz
use MRUN in various places in the connection type definitions
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/ssh.lisp')
-rw-r--r--src/connection/ssh.lisp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/connection/ssh.lisp b/src/connection/ssh.lisp
index c6acfee..2962fbc 100644
--- a/src/connection/ssh.lisp
+++ b/src/connection/ssh.lisp
@@ -24,7 +24,7 @@
(hop (get-hostname))
user)
(declare (ignore remaining))
- (run "ssh" "-fN" hop)
+ (mrun "ssh" "-fN" hop)
(make-instance 'ssh-connection :hostname hop :user user))
(defclass ssh-connection (posix-connection)
@@ -51,25 +51,22 @@
(if (cdr args) (escape-sh-command args) (car args)))))))
(defmethod connection-run ((c ssh-connection) cmd &optional input)
- (multiple-value-bind (out err exit)
- (run :may-fail :input input (sshcmd c cmd))
- (values (strcat err out) exit)))
+ (mrun :may-fail :input input (sshcmd c cmd)))
(defmethod connection-readfile ((c ssh-connection) path)
- (multiple-value-bind (out err exit-code)
- (run :may-fail
+ (multiple-value-bind (out exit-code)
+ (mrun :may-fail
(sshcmd c (format nil "test -r ~A && cat ~:*~A"
(escape-sh-token path))))
- (declare (ignore err))
(if (= 0 exit-code)
out
(error "File ~S not readable" path))))
(defmethod connection-writefile ((c ssh-connection) path contents)
(with-remote-temporary-file (temp)
- (run :input contents (sshcmd c "cat" #?">$(temp)"))
- (run "mv" temp path)))
+ (mrun :input contents (sshcmd c "cat" #?">$(temp)"))
+ (mrun "mv" temp path)))
;; rsync it straight to to its destination so rsync can do incremental updates
(defmethod connection-upload ((c ssh-connection) from to)
- (run "rsync" "-Pavc" from (format nil "~A:~A" (ssh-host c) to)))
+ (mrun "rsync" "-Pavc" from (format nil "~A:~A" (ssh-host c) to)))