I’m trying to customize my desktop form and submit script for my xfce desktop. But I keep running into and error which I’m not sure why i’m getting it.
The error is
undefined local variable or method `bc_num_slots’ for # BatchConnect::SessionContext:0x000014cde4dff590>
I set a default value for this variable in my beartooth_xfce.yml file. Here’s my file
title: “Beartooth Xfce Desktop”
cluster: “beartooth”
attributes:
desktop: “xfce”
bc_queue: spc-ondemand
bc_num_slots: 1
bc_account:
label: “Project/Account”
help: “Specify the name of your project”
bc_num_hours:
help: “The maximum number of hours your desktop session will run”
value: 1
min: 1
max: 168
required: true
node_type:
label: “Desktop Configuration”
help: “Select the CPU and memory configuration for the desktop”
widget: select
options:
- [ “1 CPU, 4GB memory”, “1:4G” ]
- [ “2 CPU, 8GB memory”, “2:8G” ]
- [ “4 CPU, 16GB memory”, “4:16G” ]
node_cpu:
label: “Desktop CPU Type”
help: “Select the CPU type for the desktop”
widget: select
default: “sandy”
options:
- [ “Sandy Bridge”, “sandy” ]
- [ “Broadwell”, “broadwell” ]
- [ “Ice Lake”, “icelake” ]
form:
- bc_account
- bc_num_hours
- node_type
- node_cpu
submit: “submit/beartooth.yml.erb”
This form defines the bc_num_slots variable.
and my submit file
<%-
emailcmd=‘ldapsearch -LLL -x -b “cn=users,cn=accounts,dc=arcc,dc=uwyo,dc=edu” uid=’ + ENV[“USER”] + ’ mail | grep “^mail:” | cut -f2 -d\ ’
emailaddr = %x[ #{emailcmd}].split(" ")
-%>
script:
email: <%= emailaddr %>
native:
- “-N”
- “<%= bc_num_slots.blank? ? 1 : bc_num_slots.to_i %>”
- “<%= ‘–cpus-per-task=’+node_type.split(”:“)[0] %>”
- “<%= ‘–mem=’+node_type.split(”:“)[1] %>”
- “<%= ‘–constraint=’+node_cpu %>”
Can anyone provide details on what I’m missing or doing wrong and how to fix it?