Closed myii closed 4 years ago
I've kept it inside the {%- elif salt['config.get']('__cli') == 'salt-call' %}
block, since that still evaluates as True
for both ssh
and local
. What I'm protecting against is a future edit, where someone mistakenly believes they can reorder the block and introduce a regression, i.e.:
{%- if salt['config.get']('__cli') == 'salt-minion' %}
{%- set cli = 'minion' %}
{%- elif salt['config.get']('__cli') == 'salt-call' %}
{%- set cli = 'local' %}
{%- elif salt['config.get']('__master_opts__', {}).get('__cli') == 'salt-ssh' %}
{%- set cli = 'ssh' %}
{%- else %}
{%- set cli = 'unknown' %}
{%- endif %}
ssh
never gets evaluated since it always gets caught by the local
conditional.Thanks, @baby-gnu.
:tada: This PR is included in version 3.7.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Describe the changes you're proposing
@baby-gnu As discussed in the comment linked above. I've gone for the very simplest option so far, which we can discuss further if necessary.
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context