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

remove 'when is defined' in main.yml #28

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

jsl6ul
Copy link
Contributor

@jsl6ul jsl6ul commented Feb 27, 2024

remove conditions 'when is defined' for cobbler_distros, cobbler_profiles and cobbler_systems, to avoid silent failure.

You have to define 'cobbler_systems: []' to maintain the same behavior, but if, for any reason, you have an undefined var in cobbler_distros or cobbler_profiles, the task will not fail silently.

remove conditions 'when is defined' for cobbler_distros,
cobbler_profiles and cobbler_systems, to avoid silent failure.

You have to define 'cobbler_systems: []' to maintain the same behavior,
but if, for any reason, you have an error in cobbler_distros or
cobbler_profiles, the task will not fail silently.
Copy link
Collaborator

@btravouillon btravouillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes the variables mandatory. Could you add a first task with an assert that ensure the variables are defined? If not, print a message to the user.

@jsl6ul
Copy link
Contributor Author

jsl6ul commented Feb 28, 2024

This change makes the variables mandatory. Could you add a first task with an assert that ensure the variables are defined? If not, print a message to the user.

we should probably define them, empty, in defaults/main. (no breaking change)

set this vars empty as default.
(to avoid a breaking change caused by deleting "when is defined")

cobbler_distros: []
cobbler_profiles: []
cobbler_systems: []
Copy link
Collaborator

@btravouillon btravouillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. 👍

@btravouillon btravouillon merged commit 21d5c30 into mila-iqia:main Apr 15, 2024
1 of 2 checks passed
@jsl6ul jsl6ul deleted the whendefined branch April 18, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants