(Fix #63636) terraform roster to use explicit priv value if defined in state#63637
(Fix #63636) terraform roster to use explicit priv value if defined in state#63637ricekab wants to merge 3 commits intosaltstack:masterfrom
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
|
Could I get feedback on this? I'd like to work on this PR to get it into a mergeable state. |
cmcmarrow
left a comment
There was a problem hiding this comment.
@ricekab thx for the PR. I would add a unit test here https://github.com/saltstack/salt/blob/master/tests/pytests/unit/roster/test_terraform.py
You would need to test _add_ssh_key(ret) and make sure that you get the right ret into ret data. So one test might have ret = {"priv": some temp file}. Another test would check the behavior if ret = {}.
|
Thanks for the feedback! I'll look into implementing this in the coming week. |
7e964ed to
f880fb9
Compare
|
Hi @cmcmarrow , ended up taking me a while before I could come back around to it - I've added a test case for it to the PR. I opted to use a separate tfstate file since the other ones were testing the correct usage of default values (which this would override). Tested on my setup using a Python 3.9 venv: |
8f78a31 to
6437444
Compare
|
This module and its associated states and tests have been transitioned to community support and are no longer maintained by the Salt Core team. The code has been removed from the Salt code-base and can be found in this repository: https://github.com/salt-extensions/community-extensions-holding/ There is currently discussion and work being done on the salt-extensions Discord channel (https://discordapp.com/channels/1200072194781368340/1208165123240370197) to document and build the infrastructure for community-supported salt extensions. There is also a Salt-Extensions Working Group that takes place on the 1st and 3rd Thursday of every month to coordinate salt-extension efforts. |
What does this PR do?
Fixes terraform roster from overriding explicit
privattributes with default behaviour.This PR does not include test cases yet as I'm not sure how to do this for Salt.
What issues does this PR fix or reference?
Fixes: #63636
Previous Behavior
Explicit
privvalues from terraform state was overriden with default values.New Behavior
If an explicit value for
privis defined, the default value determination is skipped.Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes