Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify conditional statements in slurm conf template #2714

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

hanwen-pcluste
Copy link
Contributor

@hanwen-pcluste hanwen-pcluste commented Apr 24, 2024

Uri is required by Database section. Host is required by ExternalSlurmdbd. Therefore, to check the existence of Uri or Host, we just need to check the existence of Database or ExternalSlurmdbd.

This improvement simplifies the code and reduces the burden of mocking in testing.

FYI: {% if variable %} is equivalent to {% if variable != None and variable is defined %}

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

`Uri` is required by `Database` section. `Host` is required by `ExternalSlurmdbd`. Therefore, to check the existence of `Uri` or `Host`, we just need to check the existence of `Database` or `ExternalSlurmdbd`.

This improvement simplifies the code and reduces the burden of mocking in testing.

Signed-off-by: Hanwen <[email protected]>
@hanwen-pcluste hanwen-pcluste requested review from a team as code owners April 24, 2024 13:30
@hanwen-pcluste hanwen-pcluste enabled auto-merge (rebase) April 24, 2024 13:50
@hanwen-pcluste hanwen-pcluste merged commit bba4beb into aws:develop Apr 24, 2024
61 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants