diff options
author | Arun Isaac | 2024-09-13 23:09:07 +0100 |
---|---|---|
committer | Arun Isaac | 2024-09-13 23:09:55 +0100 |
commit | 8bdefdffb27aabdf425be5afce0bcae64c6c9522 (patch) | |
tree | 4c3e596d0ae0c688e456d4fe4256e51e88d69b23 | |
parent | 823560e068c9843b755a1af285a1b1d2157811f2 (diff) | |
download | ravanan-8bdefdffb27aabdf425be5afce0bcae64c6c9522.tar.gz ravanan-8bdefdffb27aabdf425be5afce0bcae64c6c9522.tar.lz ravanan-8bdefdffb27aabdf425be5afce0bcae64c6c9522.zip |
bin: Refactor JWT reading into separate function.
* bin/ravanan (read-jwt): New function.
(main): Call read-jwt.
-rwxr-xr-x | bin/ravanan | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/ravanan b/bin/ravanan index 0237b58..da7c625 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -89,6 +89,11 @@ Slurm API batch system options: " program)) +(define (read-jwt file) + "Read JWT token from @var{file}." + (call-with-input-file file + get-string-all)) + (define main (match-lambda ((program args ...) @@ -141,8 +146,7 @@ Slurm API batch system options: #:guix-daemon-socket (assq-ref args 'guix-daemon-socket) #:slurm-api-endpoint (assq-ref args 'slurm-api-endpoint) #:slurm-jwt (and (assq-ref args 'slurm-jwt) - (call-with-input-file (assq-ref args 'slurm-jwt) - get-string-all))) + (read-jwt (assq-ref args 'slurm-jwt)))) (current-output-port) #:pretty #t) (newline (current-output-port)))))))) |