Skip to content
Snippets Groups Projects
Commit eddf21f4 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

style: use variable instead of hardcoded

parent b3395b6d
No related branches found
No related tags found
1 merge request!3style: use variable instead of hardcoded
......@@ -26,6 +26,9 @@ local grp = require("posix").grp
function slurm_job_submit(job_desc, part_list, submit_uid)
local target_group = "gpfs5"
local target_feature = "gpfs5"
local default_feature = "gpfs4"
local username = pwd.getpwuid(submit_uid).pw_name
local group_member = grp.getgrnam(target_group).gr_mem
local found = false
......@@ -35,12 +38,12 @@ function slurm_job_submit(job_desc, part_list, submit_uid)
for i,member in ipairs(group_member) do
if member == username then
found = true
job_desc.features = "gpfs5"
job_desc.features = target_feature
break
end
end
if not found then
job_desc.features = "gpfs4"
job_desc.features = default_feature
end
slurm.log_info("username:" .. username)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment