mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
offload: Drop 'remote-pipe'.
* guix/scripts/offload.scm (remote-pipe): Remove. (machine-load): Use 'open-remote-pipe*' instead of 'remote-pipe'.
This commit is contained in:
parent
cf283dd92e
commit
bc1ad4e334
1 changed files with 2 additions and 21 deletions
|
@ -249,26 +249,6 @@ (define redirect
|
|||
(object->string redirect)))))
|
||||
(open-connection #:port channel)))
|
||||
|
||||
(define* (remote-pipe session command
|
||||
#:key (quote? #t))
|
||||
"Run COMMAND (a list) on SESSION, and return an open input/output port,
|
||||
which is also an SSH channel. When QUOTE? is true, perform shell-quotation of
|
||||
all the elements of COMMAND."
|
||||
(define (shell-quote str)
|
||||
;; Sort-of shell-quote STR so it can be passed as an argument to the
|
||||
;; shell.
|
||||
(with-output-to-string
|
||||
(lambda ()
|
||||
(write str))))
|
||||
|
||||
(let* ((channel (make-channel session)))
|
||||
(channel-open-session channel)
|
||||
(channel-request-exec channel
|
||||
(string-join (if quote?
|
||||
(map shell-quote command)
|
||||
command)))
|
||||
channel))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Synchronization.
|
||||
|
@ -511,7 +491,8 @@ (define (machine-load machine)
|
|||
"Return the load of MACHINE, divided by the number of parallel builds
|
||||
allowed on MACHINE."
|
||||
(let* ((session (open-ssh-session machine))
|
||||
(pipe (remote-pipe session '("cat" "/proc/loadavg")))
|
||||
(pipe (open-remote-pipe* session OPEN_READ
|
||||
"cat" "/proc/loadavg"))
|
||||
(line (read-line pipe)))
|
||||
(close-port pipe)
|
||||
|
||||
|
|
Loading…
Reference in a new issue