aboutsummaryrefslogtreecommitdiff
path: root/src/connection
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-09-05 15:38:46 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-09-08 13:09:37 -0700
commit210a2d70570792f8fac53960557232de910bff37 (patch)
tree4060cbe2298a02426b2df7c31507512c948a6c1e /src/connection
parenta41a42f86145909bafa1d7ce75a2ca3a9944e7fa (diff)
downloadconsfigurator-210a2d70570792f8fac53960557232de910bff37.tar.gz
add dep on Anaphora and use APROG1, ALET & AAND in various places
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection')
-rw-r--r--src/connection/chroot.lisp7
-rw-r--r--src/connection/ssh.lisp5
-rw-r--r--src/connection/sudo.lisp9
3 files changed, 9 insertions, 12 deletions
diff --git a/src/connection/chroot.lisp b/src/connection/chroot.lisp
index 8b144cb..70a603d 100644
--- a/src/connection/chroot.lisp
+++ b/src/connection/chroot.lisp
@@ -81,10 +81,9 @@ should be the mount point, without the chroot's root prefixed.")
when (and (subtypep (type-of volume) 'disk:filesystem)
(slot-boundp volume 'disk:mount-point)
(subpathp (disk:mount-point volume) into))
- collect (let ((copy (disk:copy-volume-and-contents volume)))
- (setf (disk:mount-point copy)
- (in-chroot-pathname (disk:mount-point copy) into))
- copy)
+ collect (aprog1 (disk:copy-volume-and-contents volume)
+ (setf (disk:mount-point it)
+ (in-chroot-pathname (disk:mount-point it) into)))
else collect volume)))
(defmethod propagate-connattr
diff --git a/src/connection/ssh.lisp b/src/connection/ssh.lisp
index 38fd2ae..f4d30cc 100644
--- a/src/connection/ssh.lisp
+++ b/src/connection/ssh.lisp
@@ -24,9 +24,8 @@
user)
(declare (ignore remaining))
(informat 1 "~&Establishing SSH connection to ~A" hop)
- (let ((connection (make-instance 'ssh-connection :hostname hop :user user)))
- (mrun "ssh" (ssh-host connection) ":")
- connection))
+ (aprog1 (make-instance 'ssh-connection :hostname hop :user user)
+ (mrun "ssh" (ssh-host it) ":")))
(defclass ssh-connection (shell-wrap-connection)
((hostname
diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp
index 4c817f8..da50673 100644
--- a/src/connection/sudo.lisp
+++ b/src/connection/sudo.lisp
@@ -62,14 +62,13 @@
'sudo-connection
:connattrs `(:remote-user ,user)
:password-file (and password
- (let ((file (mktemp)))
+ (aprog1 (mktemp)
;; We'll send the password followed by ^M, then the
;; real stdin. Use CODE-CHAR in this way so that we
;; can be sure ASCII ^M is what will get emitted.
- (writefile file (strcat (passphrase password)
- (string (code-char 13)))
- :mode #o600)
- file))))
+ (writefile it (strcat (passphrase password)
+ (string (code-char 13)))
+ :mode #o600)))))
(defmethod connection-teardown :after ((connection sudo-connection))
(when-let ((file (slot-value connection 'password-file)))