Skip to content

Commit

Permalink
Handle (null) tres in str_to_queue_info. (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
pddro-Vestas authored Feb 5, 2025
1 parent ea17294 commit f468706
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ood_core/job/adapters/slurm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,14 @@ def str_to_queue_info(line)
hsh[:AllowAccounts].to_s.split(',')
end


hsh[:deny_accounts] = hsh[:DenyAccounts].nil? ? [] : hsh[:DenyAccounts].to_s.split(',')
hsh[:tres] = hsh[:TRES].nil? ? {} : hsh[:TRES].to_s.split(',').map { |str| str.split('=') }.to_h

hsh[:tres] = case hsh[:TRES]
when nil, '(null)', ''
{}
else
hsh[:TRES].to_s.split(',').map { |str| str.split('=') }.to_h
end
OodCore::Job::QueueInfo.new(**hsh)
end

Expand Down

0 comments on commit f468706

Please sign in to comment.