diff options
author | Arun Isaac | 2024-09-13 23:12:05 +0100 |
---|---|---|
committer | Arun Isaac | 2024-09-13 23:15:59 +0100 |
commit | 4d5ab14d78fbe9305f56bead350405846a888757 (patch) | |
tree | 348bcf3f0f6022c05333081cf3fc658b429672a7 | |
parent | 8bdefdffb27aabdf425be5afce0bcae64c6c9522 (diff) | |
download | ravanan-4d5ab14d78fbe9305f56bead350405846a888757.tar.gz ravanan-4d5ab14d78fbe9305f56bead350405846a888757.tar.lz ravanan-4d5ab14d78fbe9305f56bead350405846a888757.zip |
bin: Support SLURM_JWT=token format in JWT files.
* bin/ravanan: Import (srfi srfi-26) and (ravanan utils).
(read-jwt): Support SLURM_JWT=token format.
-rwxr-xr-x | bin/ravanan | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/ravanan b/bin/ravanan index da7c625..1d08dc6 100755 --- a/bin/ravanan +++ b/bin/ravanan @@ -21,12 +21,14 @@ exec guile --no-auto-compile -e main -s "$0" "$@" ;;; along with ravanan. If not, see <https://www.gnu.org/licenses/>. (use-modules (rnrs io ports) + (srfi srfi-26) (srfi srfi-37) (ice-9 filesystem) (ice-9 match) (web uri) (json) (ravanan reader) + (ravanan utils) (ravanan workflow) ;; required to load manifest files @@ -90,9 +92,12 @@ Slurm API batch system options: program)) (define (read-jwt file) - "Read JWT token from @var{file}." + "Read JWT token from @var{file}. Support both files that only have the token and +files that have the token in the @verbatim{SLURM_JWT=token} format." (call-with-input-file file - get-string-all)) + (compose (cut string-trim-prefix "SLURM_JWT=" <>) + string-trim-both + get-string-all))) (define main (match-lambda |