[master] Add Salt package type to versions report and grain#64446
[master] Add Salt package type to versions report and grain#64446s0undt3ch merged 10 commits intosaltstack:masterfrom
Conversation
|
It would be great if this was a grain that was fully self contained, that would mean it could be synced to older minions. I understand while its currently written to use a module but having this be code that syncs from the master to all existing minion versions would be useful. |
| Test that the package grain returns onedir | ||
| """ | ||
| ret = salt_cli.run("grains.get", "package", minion_tgt=salt_minion.id) | ||
| assert "onedir" == ret.data |
There was a problem hiding this comment.
| assert "onedir" == ret.data | |
| assert ret.data == "onedir" |
Assert what we get against what we expect. Looks more logical in case of failures on pytest diff's
There was a problem hiding this comment.
This should probably be placed in salt/.
When you pip install salt, where does this file land? site-packages/_pkg.txt?
tests/pytests/unit/conftest.py
Outdated
|
|
||
|
|
||
| @pytest.fixture(scope="package", autouse=True) | ||
| def onedir_env(): |
There was a problem hiding this comment.
| def onedir_env(): | |
| def _onedir_env(): |
Since it's an auto use fixture, let's prefix it with _ so that it gets hidden on the possible fixtures to use shown by pytest.
|
@s0undt3ch this is ready, but I believe it clashes with your pytest factories PR. Did you want to merge this one in first or yours? The new pytest fixtures Iadd will need to be removed when your PR is added |
|
okay I just merged in your PR #63334 I'll go ahead and update this PR now |
This reverts commit b2dfd5e.
Sorry, totally missed this message. |
|
@meaksh just thought you would want to be aware of this new change for packaging purposes. |
What does this PR do?
Adds the package type to the Salt versions type and adds a grain.
This value will be either 'system' or 'onedir'
What issues does this PR fix or reference?
Fixes: #62961
Fixes: #62589
Previous Behavior
Could not determine package type in Salt.
New Behavior
Can determine package type either via versions report or calling the grain.
New Versions Report:
New grain type: