Skip to content

Commit

Permalink
updated to properly check for NodeName in gres dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Guldberg Aaes committed Nov 14, 2023
1 parent a00d4dc commit 0bd6ba6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/gres.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
##

{% set conf = lookup('vars', item.config) %}
{% for key in conf %}
{% if key['NodeName'] is not none %}
NodeName={{ key['NodeName'] }}{% for key in key | sort %}{% if key != 'NodeName' %} {{ key }}={{ key[key] }}{% endif %}{% endfor %}
{% for gres in conf %}
{% if 'NodeName' in gres %}
NodeName={{ gres['NodeName'] }}{% for gres in gres | sort %}{% if gres != 'NodeName' %} {{ gres }}={{ gres[gres] }}{% endif %}{% endfor %}
{% else %}
{% set val = key[key] %}
{% set val = gres[gres] %}
{% if val is not none and val != omit %}
{{ key }}={{ 'yes' if val is sameas true else ('no' if val is sameas false else val) }}
{{ gres }}={{ 'yes' if val is sameas true else ('no' if val is sameas false else val) }}
{% endif %}
{% endif %}
{% endfor %}

0 comments on commit 0bd6ba6

Please sign in to comment.