Skip to content

Commit f468706

Browse files
authored
Handle (null) tres in str_to_queue_info. (#865)
1 parent ea17294 commit f468706

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ood_core/job/adapters/slurm.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,14 @@ def str_to_queue_info(line)
372372
hsh[:AllowAccounts].to_s.split(',')
373373
end
374374

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

377+
hsh[:tres] = case hsh[:TRES]
378+
when nil, '(null)', ''
379+
{}
380+
else
381+
hsh[:TRES].to_s.split(',').map { |str| str.split('=') }.to_h
382+
end
379383
OodCore::Job::QueueInfo.new(**hsh)
380384
end
381385

0 commit comments

Comments
 (0)