From 494ea5d964984c1b7cfad818cb907c9cd24e13f7 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Fri, 19 Aug 2022 11:43:37 -0500
Subject: [PATCH] Get partition list from cluster config

---
 form.yml.erb | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/form.yml.erb b/form.yml.erb
index 25f6162..fb750dc 100644
--- a/form.yml.erb
+++ b/form.yml.erb
@@ -1,3 +1,6 @@
+<%-
+  partitions = OodAppkit.clusters[:SLURM_CLUSTER].custom_config[:partitions]
+-%>
 ---
 cluster: "SLURM_CLUSTER"
 attributes:
@@ -41,19 +44,9 @@ attributes:
     widget: select
     label: Partition
     options:
-      - [ "express", "express" ]
-      - [ "short", "short" ]
-      - [ "medium", "medium" ]
-      - [ "long", "long" ]
-      - [ "interactive", "interactive" ]
-      - [ "pascalnodes", "pascalnodes" ]
-      - [ "pascalnodes-medium", "pascalnodes-medium" ]
-      - [ "largemem", "largemem" ]
-      - [ "largemem-long", "largemem-long" ]
-      - [ "amd-hdr100", "amd-hdr100" ]
-      - [ "intel-dcb", "intel-dcb" ]
-      - [ "amperenodes", "amperenodes" ]
-      - [ "amperenodes-medium", "amperenodes-medium" ]
+    <%- partitions.each do |p| -%>
+      - [ "<%= p %>", "<%= p %>" ]
+    <%- end -%>
 
   version:
     widget: select
-- 
GitLab