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

Add salt_version execution module #49891

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

rallytime
Copy link
Contributor

What does this PR do?

This execution module exposes Salt's release codenames as functions that can be used to make comparison's to the minion's Salt version.

This is useful when writing states that handle deprecations. By exposing the release codenames, people can use these comparisons in Jinja statements in state files. This is only one example and the use case I wanted to cover here. There may be more that I haven't thought of, but this is a start!

What issues does this PR fix or reference?

None that I know of.

Tests written?

Yes

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

This execution module exposes Salt's release codenames as functions
that can be used to make comparison's to the minion's Salt version.

This is useful when writing states that handle deprecations. By exposing
the release codenames, people can use these comparisons in Jinja statements
in statefiles. This is only one example and the use case I wanted to cover
here. There may be more that I haven't thought of, but this is a start!
@rallytime rallytime requested a review from a team October 3, 2018 22:05
@gtmanfred gtmanfred merged commit d27a2a5 into saltstack:develop Oct 4, 2018
@rallytime rallytime deleted the salt-version-module branch October 4, 2018 12:37
@max-arnold
Copy link
Contributor

Am I the only one who reads salt_version.is_newer('Sodium') as current minion version is newer (greater) than Sodium? The function docstring and behavior seem backward: Returns a boolean if the named version is newer that the minion's current Salt version.

@max-arnold
Copy link
Contributor

@rallytime Hey! Do you plan to backport this feature to master branch (neon is not going to be released as is)?

@max-arnold
Copy link
Contributor

I went ahead and ported the PR: #55195

max-arnold pushed a commit to max-arnold/salt that referenced this pull request Nov 15, 2019
dwoz added a commit that referenced this pull request Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants