Skip to content

Commit

Permalink
Fix bug introduced with DatabaseName functionality
Browse files Browse the repository at this point in the history
When Slurm Accounting is used but DatabaseName is not defined in the
input config, it is rendered as `null` in the config on the cluster,
which is translated to `none` in Jinja2.

This means that the value passes the `is defined` test in Jinja2.

Fix the if condition in Jinja2 to check if `DatabaseName` is not `none`
before trying to set it in `StorageLoc` in the slurmdbd configuration.

Fix the unit test to have `DatabaseName` equal to `null` in the case
when Slurm Accounting is used with default database name.

Signed-off-by: Jacopo De Amicis <[email protected]>
  • Loading branch information
jdeamicis committed Nov 14, 2023
1 parent 5f7b7b9 commit 5b09524
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{# #}DbdHost={{ head_node_config.head_node_hostname }}
{# #}StorageHost={{ scaling_config.Database.Uri | uri_host }}
{# #}StoragePort={{ scaling_config.Database.Uri | uri_port }}
{# #}{% if scaling_config.Database.DatabaseName is defined %}
{# #}{% if scaling_config.Database.DatabaseName is defined and scaling_config.Database.DatabaseName is not none %}
{# #}StorageLoc={{ scaling_config.Database.DatabaseName }}
{# #}{% else %}
{# #}{# Dashes in StorageLoc cause issues with the database creation #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ Scheduling:
Uri: test.databaseserver.com
UserName: test_admin
PasswordSecretArn: arn:aws:secretsmanager:us-east-1:111111111111:secret:Secret-xxxxxxxx-xxxxx
DatabaseName: null

0 comments on commit 5b09524

Please sign in to comment.