Permit an absent preferences pillar data key #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
preferences.sls
file has a line like:{% set preferences = apt.get('preferences', apt_map.preferences) %}
In my pillar sls, I had an if condition such as:
When instances were upgraded to stretch, the preference key was no longer used which resulted in
Data failed to compile:
errors when trying to run highstate (sinceapt.preferences
is still listed there).In theory, I could just update
top.sls
to also have the same if condition around theapt.preferences
reference, however that approach would lead to unnecessary code duplication - particularly as more if conditions need to be added for different os releases. Instead, I propose here we set a defaultpreferences
key with the value of an empty dict so the state can complete without error but still essentially do nothing.