ssh.scm 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
  3. ;;; Copyright © 2020-2022 Ludovic Courtès <ludo@gnu.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu machine ssh)
  20. #:use-module (gnu bootloader)
  21. #:use-module (gnu machine)
  22. #:autoload (gnu packages gnupg) (guile-gcrypt)
  23. #:use-module (gnu system)
  24. #:use-module (gnu system file-systems)
  25. #:use-module (gnu system uuid)
  26. #:use-module ((gnu services) #:select (sexp->system-provenance))
  27. #:use-module (guix diagnostics)
  28. #:use-module (guix memoization)
  29. #:use-module (guix gexp)
  30. #:use-module (guix i18n)
  31. #:use-module (guix modules)
  32. #:use-module (guix monads)
  33. #:use-module (guix pki)
  34. #:use-module (guix records)
  35. #:use-module (guix remote)
  36. #:use-module (guix scripts system reconfigure)
  37. #:use-module (guix ssh)
  38. #:use-module (guix store)
  39. #:use-module (guix utils)
  40. #:use-module ((guix self) #:select (make-config.scm))
  41. #:use-module ((guix inferior)
  42. #:select (inferior-exception?
  43. inferior-exception-arguments))
  44. #:use-module (gcrypt pk-crypto)
  45. #:use-module (ice-9 format)
  46. #:use-module (ice-9 match)
  47. #:use-module (ice-9 textual-ports)
  48. #:use-module (srfi srfi-1)
  49. #:use-module (srfi srfi-9)
  50. #:use-module (srfi srfi-19)
  51. #:use-module (srfi srfi-26)
  52. #:use-module (srfi srfi-34)
  53. #:use-module (srfi srfi-35)
  54. #:export (managed-host-environment-type
  55. machine-ssh-configuration
  56. machine-ssh-configuration?
  57. machine-ssh-configuration
  58. machine-ssh-configuration-host-name
  59. machine-ssh-configuration-build-locally?
  60. machine-ssh-configuration-authorize?
  61. machine-ssh-configuration-allow-downgrades?
  62. machine-ssh-configuration-port
  63. machine-ssh-configuration-user
  64. machine-ssh-configuration-host-key
  65. machine-ssh-configuration-session))
  66. ;;; Commentary:
  67. ;;;
  68. ;;; This module implements remote evaluation and system deployment for
  69. ;;; machines that are accessible over SSH and have a known host-name. In the
  70. ;;; sense of the broader "machine" interface, we describe the environment for
  71. ;;; such machines as 'managed-host.
  72. ;;;
  73. ;;; Code:
  74. ;;;
  75. ;;; Parameters for the SSH client.
  76. ;;;
  77. (define-record-type* <machine-ssh-configuration> machine-ssh-configuration
  78. make-machine-ssh-configuration
  79. machine-ssh-configuration?
  80. this-machine-ssh-configuration
  81. (host-name machine-ssh-configuration-host-name) ; string
  82. (system machine-ssh-configuration-system) ; string
  83. (build-locally? machine-ssh-configuration-build-locally? ; boolean
  84. (default #t))
  85. (authorize? machine-ssh-configuration-authorize? ; boolean
  86. (default #t))
  87. (allow-downgrades? machine-ssh-configuration-allow-downgrades? ; boolean
  88. (default #f))
  89. (safety-checks? machine-ssh-configuration-safety-checks? ;boolean
  90. (default #t))
  91. (port machine-ssh-configuration-port ; integer
  92. (default 22))
  93. (user machine-ssh-configuration-user ; string
  94. (default "root"))
  95. (identity machine-ssh-configuration-identity ; path to a private key
  96. (default #f))
  97. (session machine-ssh-configuration-session ; session
  98. (thunked)
  99. (default
  100. ;; By default, open the session once and cache it.
  101. (open-machine-ssh-session* this-machine-ssh-configuration)))
  102. (host-key machine-ssh-configuration-host-key ; #f | string
  103. (default #f)))
  104. (define (open-machine-ssh-session config)
  105. "Open an SSH session for CONFIG, a <machine-ssh-configuration> record."
  106. (let ((host-name (machine-ssh-configuration-host-name config))
  107. (user (machine-ssh-configuration-user config))
  108. (port (machine-ssh-configuration-port config))
  109. (identity (machine-ssh-configuration-identity config))
  110. (host-key (machine-ssh-configuration-host-key config)))
  111. (unless host-key
  112. (warning (G_ "<machine-ssh-configuration> without a 'host-key' \
  113. is deprecated~%")))
  114. (open-ssh-session host-name
  115. #:user user
  116. #:port port
  117. #:identity identity
  118. #:host-key host-key)))
  119. (define open-machine-ssh-session*
  120. (mlambdaq (config)
  121. "Memoizing variant of 'open-machine-ssh-session'."
  122. (open-machine-ssh-session config)))
  123. (define (machine-ssh-session machine)
  124. "Return the SSH session that was given in MACHINE's configuration, or create
  125. one from the configuration's parameters if one was not provided."
  126. (maybe-raise-unsupported-configuration-error machine)
  127. (let ((config (machine-configuration machine)))
  128. (or (machine-ssh-configuration-session config)
  129. (open-machine-ssh-session config))))
  130. ;;;
  131. ;;; Remote evaluation.
  132. ;;;
  133. (define (machine-become-command machine)
  134. "Return as a list of strings the program and arguments necessary to run a
  135. shell command with escalated privileges for MACHINE's configuration."
  136. (if (string= "root" (machine-ssh-configuration-user
  137. (machine-configuration machine)))
  138. '()
  139. '("/run/setuid-programs/sudo" "-n" "--")))
  140. (define (managed-host-remote-eval machine exp)
  141. "Internal implementation of 'machine-remote-eval' for MACHINE instances with
  142. an environment type of 'managed-host."
  143. (maybe-raise-unsupported-configuration-error machine)
  144. (let ((config (machine-configuration machine)))
  145. (remote-eval exp (machine-ssh-session machine)
  146. #:build-locally?
  147. (machine-ssh-configuration-build-locally? config)
  148. #:system
  149. (machine-ssh-configuration-system config)
  150. #:become-command
  151. (machine-become-command machine))))
  152. ;;;
  153. ;;; Safety checks.
  154. ;;;
  155. ;; Assertion to be executed remotely. This abstraction exists to allow us to
  156. ;; gather a list of expressions to be evaluated and eventually evaluate them
  157. ;; all at once instead of one by one. (This is pretty much a monad.)
  158. (define-record-type <remote-assertion>
  159. (remote-assertion exp proc)
  160. remote-assertion?
  161. (exp remote-assertion-expression)
  162. (proc remote-assertion-procedure))
  163. (define-syntax-rule (remote-let ((var exp)) body ...)
  164. "Return a <remote-assertion> that binds VAR to the result of evaluating EXP,
  165. a gexp, remotely, and evaluate BODY in that context."
  166. (remote-assertion exp (lambda (var) body ...)))
  167. (define (machine-check-file-system-availability machine)
  168. "Return a list of <remote-assertion> that raise a '&message' error condition
  169. if any of the file-systems specified in MACHINE's 'system' declaration do not
  170. exist on the machine."
  171. (define file-systems
  172. (filter (lambda (fs)
  173. (and (file-system-mount? fs)
  174. (not (member (file-system-type fs)
  175. %pseudo-file-system-types))
  176. ;; Don't try to validate network file systems.
  177. (not (string-prefix? "nfs" (file-system-type fs)))
  178. (not (memq 'bind-mount (file-system-flags fs)))))
  179. (operating-system-file-systems (machine-operating-system machine))))
  180. (define (check-literal-file-system fs)
  181. (remote-let ((errno #~(catch 'system-error
  182. (lambda ()
  183. (stat #$(file-system-device fs))
  184. #t)
  185. (lambda args
  186. (system-error-errno args)))))
  187. (when (number? errno)
  188. (raise (formatted-message (G_ "device '~a' not found: ~a")
  189. (file-system-device fs)
  190. (strerror errno))))))
  191. (define (check-labeled-file-system fs)
  192. (define remote-exp
  193. (with-imported-modules (source-module-closure
  194. '((gnu build file-systems)))
  195. #~(begin
  196. (use-modules (gnu build file-systems))
  197. (find-partition-by-label #$(file-system-label->string
  198. (file-system-device fs))))))
  199. (remote-let ((result remote-exp))
  200. (unless result
  201. (raise (formatted-message (G_ "no file system with label '~a'")
  202. (file-system-label->string
  203. (file-system-device fs)))))))
  204. (define (check-uuid-file-system fs)
  205. (define remote-exp
  206. (with-imported-modules (source-module-closure
  207. '((gnu build file-systems)
  208. (gnu system uuid)))
  209. #~(begin
  210. (use-modules (gnu build file-systems)
  211. (gnu system uuid))
  212. (let ((uuid (uuid #$(uuid->string (file-system-device fs))
  213. '#$(uuid-type (file-system-device fs)))))
  214. (find-partition-by-uuid uuid)))))
  215. (remote-let ((result remote-exp))
  216. (unless result
  217. (raise (formatted-message (G_ "no file system with UUID '~a'")
  218. (uuid->string (file-system-device fs)))))))
  219. (if (machine-ssh-configuration-safety-checks?
  220. (machine-configuration machine))
  221. (append (map check-literal-file-system
  222. (filter (lambda (fs)
  223. (string? (file-system-device fs)))
  224. file-systems))
  225. (map check-labeled-file-system
  226. (filter (lambda (fs)
  227. (file-system-label? (file-system-device fs)))
  228. file-systems))
  229. (map check-uuid-file-system
  230. (filter (lambda (fs)
  231. (uuid? (file-system-device fs)))
  232. file-systems)))
  233. '()))
  234. (define (machine-check-initrd-modules machine)
  235. "Return a list of <remote-assertion> that raise a '&message' error condition
  236. if any of the modules needed by 'needed-for-boot' file systems in MACHINE are
  237. not available in the initrd."
  238. (define file-systems
  239. (filter file-system-needed-for-boot?
  240. (operating-system-file-systems (machine-operating-system machine))))
  241. (define (missing-modules fs)
  242. (define remote-exp
  243. (let ((device (file-system-device fs)))
  244. (with-imported-modules (source-module-closure
  245. '((gnu build file-systems)
  246. (gnu build linux-modules)
  247. (gnu system uuid)))
  248. #~(begin
  249. (use-modules (gnu build file-systems)
  250. (gnu build linux-modules)
  251. (gnu system uuid))
  252. (define dev
  253. #$(cond ((string? device) device)
  254. ((uuid? device) #~(find-partition-by-uuid
  255. (string->uuid
  256. #$(uuid->string device))))
  257. ((file-system-label? device)
  258. #~(find-partition-by-label
  259. #$(file-system-label->string device)))))
  260. (missing-modules dev '#$(operating-system-initrd-modules
  261. (machine-operating-system machine)))))))
  262. (remote-let ((missing remote-exp))
  263. (unless (null? missing)
  264. (raise (formatted-message (G_ "missing modules for ~a:~{ ~a~}~%")
  265. (file-system-device fs)
  266. missing)))))
  267. (if (machine-ssh-configuration-safety-checks?
  268. (machine-configuration machine))
  269. (map missing-modules file-systems)
  270. '()))
  271. (define* (machine-check-forward-update machine)
  272. "Check whether we are making a forward update for MACHINE. Depending on its
  273. 'allow-upgrades?' field, raise an error or display a warning if we are
  274. potentially downgrading it."
  275. (define config
  276. (machine-configuration machine))
  277. (define validate-reconfigure
  278. (if (machine-ssh-configuration-allow-downgrades? config)
  279. warn-about-backward-reconfigure
  280. ensure-forward-reconfigure))
  281. (remote-let ((provenance #~(call-with-input-file
  282. "/run/current-system/provenance"
  283. read)))
  284. (define channels
  285. (sexp->system-provenance provenance))
  286. (check-forward-update validate-reconfigure
  287. #:current-channels channels)))
  288. (define (machine-check-building-for-appropriate-system machine)
  289. "Raise a '&message' error condition if MACHINE is configured to be built
  290. locally and the 'system' field does not match the '%current-system' reported
  291. by MACHINE."
  292. (let ((config (machine-configuration machine))
  293. (system (remote-system (machine-ssh-session machine))))
  294. (when (and (machine-ssh-configuration-build-locally? config)
  295. (not (string= system (machine-ssh-configuration-system config))))
  296. (raise (formatted-message (G_ "incorrect target system\
  297. ('~a' was given, while the system reports that it is '~a')~%")
  298. (machine-ssh-configuration-system config)
  299. system)))))
  300. (define (check-deployment-sanity machine)
  301. "Raise a '&message' error condition if it is clear that deploying MACHINE's
  302. 'system' declaration would fail."
  303. (define assertions
  304. (parameterize ((%current-system
  305. (machine-ssh-configuration-system
  306. (machine-configuration machine)))
  307. (%current-target-system #f))
  308. (append (machine-check-file-system-availability machine)
  309. (machine-check-initrd-modules machine)
  310. (list (machine-check-forward-update machine)))))
  311. (define aggregate-exp
  312. ;; Gather all the expressions so that a single round-trip is enough to
  313. ;; evaluate all the ASSERTIONS remotely.
  314. #~(map (lambda (file)
  315. (false-if-exception (primitive-load file)))
  316. '#$(map (lambda (assertion)
  317. (scheme-file "remote-assertion.scm"
  318. (remote-assertion-expression assertion)))
  319. assertions)))
  320. ;; First check MACHINE's system type--an incorrect value for 'system' would
  321. ;; cause subsequent invocations of 'remote-eval' to fail.
  322. (machine-check-building-for-appropriate-system machine)
  323. (mlet %store-monad ((values (machine-remote-eval machine aggregate-exp)))
  324. (for-each (lambda (proc value)
  325. (proc value))
  326. (map remote-assertion-procedure assertions)
  327. values)
  328. (return #t)))
  329. ;;;
  330. ;;; System deployment.
  331. ;;;
  332. (define not-config?
  333. ;; Select (guix …) and (gnu …) modules, except (guix config).
  334. (match-lambda
  335. (('guix 'config) #f)
  336. (('guix _ ...) #t)
  337. (('gnu _ ...) #t)
  338. (_ #f)))
  339. (define (machine-boot-parameters machine)
  340. "Monadic procedure returning a list of 'boot-parameters' for the generations
  341. of MACHINE's system profile, ordered from most recent to oldest."
  342. (define bootable-kernel-arguments
  343. (@@ (gnu system) bootable-kernel-arguments))
  344. (define remote-exp
  345. (with-extensions (list guile-gcrypt)
  346. (with-imported-modules `(((guix config) => ,(make-config.scm))
  347. ,@(source-module-closure
  348. '((guix profiles))
  349. #:select? not-config?))
  350. #~(begin
  351. (use-modules (guix config)
  352. (guix profiles)
  353. (ice-9 textual-ports))
  354. (define %system-profile
  355. (string-append %state-directory "/profiles/system"))
  356. (define (read-file path)
  357. (call-with-input-file path
  358. (lambda (port)
  359. (get-string-all port))))
  360. (map (lambda (generation)
  361. (let* ((system-path (generation-file-name %system-profile
  362. generation))
  363. (boot-parameters-path (string-append system-path
  364. "/parameters"))
  365. (time (stat:mtime (lstat system-path))))
  366. (list generation
  367. system-path
  368. time
  369. (read-file boot-parameters-path))))
  370. (reverse (generation-numbers %system-profile)))))))
  371. (mlet* %store-monad ((generations (machine-remote-eval machine remote-exp)))
  372. (return
  373. (map (lambda (generation)
  374. (match generation
  375. ((generation system-path time serialized-params)
  376. (let* ((params (call-with-input-string serialized-params
  377. read-boot-parameters))
  378. (root (boot-parameters-root-device params))
  379. (label (boot-parameters-label params))
  380. (version (boot-parameters-version params)))
  381. (boot-parameters
  382. (inherit params)
  383. (label
  384. (string-append label " (#"
  385. (number->string generation) ", "
  386. (let ((time (make-time time-utc 0 time)))
  387. (date->string (time-utc->date time)
  388. "~Y-~m-~d ~H:~M"))
  389. ")"))
  390. (kernel-arguments
  391. (append (bootable-kernel-arguments system-path root version)
  392. (boot-parameters-kernel-arguments params))))))))
  393. generations))))
  394. (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
  395. "Catch exceptions that arise when binding MBODY, a monadic expression in
  396. %STORE-MONAD, and collect their arguments in a &deploy-error condition, with
  397. the 'should-roll-back' field set to SHOULD-ROLL-BACK?"
  398. (catch #t
  399. (lambda ()
  400. mbody ...)
  401. (lambda args
  402. (raise (condition (&deploy-error
  403. (should-roll-back should-roll-back?)
  404. (captured-args args)))))))
  405. (define (deploy-managed-host machine)
  406. "Internal implementation of 'deploy-machine' for MACHINE instances with an
  407. environment type of 'managed-host."
  408. (define config (machine-configuration machine))
  409. (define host (machine-ssh-configuration-host-name config))
  410. (define system (machine-ssh-configuration-system config))
  411. (maybe-raise-unsupported-configuration-error machine)
  412. (when (machine-ssh-configuration-authorize?
  413. (machine-configuration machine))
  414. (unless (file-exists? %public-key-file)
  415. (raise (formatted-message (G_ "no signing key '~a'. \
  416. have you run 'guix archive --generate-key?'")
  417. %public-key-file)))
  418. (remote-authorize-signing-key (call-with-input-file %public-key-file
  419. (lambda (port)
  420. (string->canonical-sexp
  421. (get-string-all port))))
  422. (machine-ssh-session machine)
  423. (machine-become-command machine)))
  424. (mlet %store-monad ((_ (check-deployment-sanity machine))
  425. (boot-parameters (machine-boot-parameters machine)))
  426. ;; Make sure code that check %CURRENT-SYSTEM, such as
  427. ;; %BASE-INITRD-MODULES, gets to see the right value.
  428. (parameterize ((%current-system system)
  429. (%current-target-system #f))
  430. (let* ((os (machine-operating-system machine))
  431. (eval (cut machine-remote-eval machine <>))
  432. (menu-entries (map boot-parameters->menu-entry boot-parameters))
  433. (bootloader-configuration (operating-system-bootloader os))
  434. (bootcfg (operating-system-bootcfg os menu-entries)))
  435. (define-syntax-rule (eval/error-handling condition handler ...)
  436. ;; Return a wrapper around EVAL such that HANDLER is evaluated if an
  437. ;; exception is raised.
  438. (lambda (exp)
  439. (lambda (store)
  440. (guard (condition ((inferior-exception? condition)
  441. (values (begin handler ...) store)))
  442. (values (run-with-store store (eval exp)
  443. #:system system)
  444. store)))))
  445. (mbegin %store-monad
  446. (with-roll-back #f
  447. (switch-to-system (eval/error-handling c
  448. (raise (formatted-message
  449. (G_ "\
  450. failed to switch systems while deploying '~a':~%~{~s ~}")
  451. host
  452. (inferior-exception-arguments c))))
  453. os))
  454. (with-roll-back #t
  455. (mbegin %store-monad
  456. (upgrade-shepherd-services (eval/error-handling c
  457. (warning (G_ "\
  458. an error occurred while upgrading services on '~a':~%~{~s ~}~%")
  459. host
  460. (inferior-exception-arguments
  461. c)))
  462. os)
  463. (install-bootloader (eval/error-handling c
  464. (raise (formatted-message
  465. (G_ "\
  466. failed to install bootloader on '~a':~%~{~s ~}~%")
  467. host
  468. (inferior-exception-arguments c))))
  469. bootloader-configuration bootcfg))))))))
  470. ;;;
  471. ;;; Roll-back.
  472. ;;;
  473. (define (roll-back-managed-host machine)
  474. "Internal implementation of 'roll-back-machine' for MACHINE instances with
  475. an environment type of 'managed-host."
  476. (define remote-exp
  477. (with-extensions (list guile-gcrypt)
  478. (with-imported-modules (source-module-closure '((guix config)
  479. (guix profiles)))
  480. #~(begin
  481. (use-modules (guix config)
  482. (guix profiles))
  483. (define %system-profile
  484. (string-append %state-directory "/profiles/system"))
  485. (define target-generation
  486. (relative-generation %system-profile -1))
  487. (if target-generation
  488. (switch-to-generation %system-profile target-generation)
  489. 'error)))))
  490. (define roll-back-failure
  491. (condition (&message (message (G_ "could not roll-back machine")))))
  492. (mlet* %store-monad ((boot-parameters (machine-boot-parameters machine))
  493. (_ -> (if (< (length boot-parameters) 2)
  494. (raise roll-back-failure)))
  495. (entries -> (map boot-parameters->menu-entry
  496. (list (second boot-parameters))))
  497. (locale -> (boot-parameters-locale
  498. (second boot-parameters)))
  499. (crypto-dev -> (boot-parameters-store-crypto-devices
  500. (second boot-parameters)))
  501. (store-dir -> (boot-parameters-store-directory-prefix
  502. (second boot-parameters)))
  503. (old-entries -> (map boot-parameters->menu-entry
  504. (drop boot-parameters 2)))
  505. (bootloader -> (operating-system-bootloader
  506. (machine-operating-system machine)))
  507. (bootcfg (lower-object
  508. ((bootloader-configuration-file-generator
  509. (bootloader-configuration-bootloader
  510. bootloader))
  511. bootloader entries
  512. #:locale locale
  513. #:store-crypto-devices crypto-dev
  514. #:store-directory-prefix store-dir
  515. #:old-entries old-entries)))
  516. (remote-result (machine-remote-eval machine remote-exp)))
  517. (when (eqv? 'error remote-result)
  518. (raise roll-back-failure))))
  519. ;;;
  520. ;;; Environment type.
  521. ;;;
  522. (define managed-host-environment-type
  523. (environment-type
  524. (machine-remote-eval managed-host-remote-eval)
  525. (deploy-machine deploy-managed-host)
  526. (roll-back-machine roll-back-managed-host)
  527. (name 'managed-host-environment-type)
  528. (description "Provisioning for machines that are accessible over SSH
  529. and have a known host-name. This entails little more than maintaining an SSH
  530. connection to the host.")))
  531. (define (maybe-raise-unsupported-configuration-error machine)
  532. "Raise an error if MACHINE's configuration is not an instance of
  533. <machine-ssh-configuration>."
  534. (let ((config (machine-configuration machine))
  535. (environment (environment-type-name (machine-environment machine))))
  536. (unless (and config (machine-ssh-configuration? config))
  537. (raise (formatted-message (G_ "unsupported machine configuration '~a'
  538. for environment of type '~a'")
  539. config
  540. environment)))))
  541. ;; Local Variables:
  542. ;; eval: (put 'remote-let 'scheme-indent-function 1)
  543. ;; eval: (put 'with-roll-back 'scheme-indent-function 1)
  544. ;; eval: (put 'eval/error-handling 'scheme-indent-function 1)
  545. ;; End: