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

[FEATURE REQUEST] new core grain - a grain for telling if current salt build is onedir/singlebin/system packaged python #62589

Closed
ITJamie opened this issue Aug 31, 2022 · 8 comments · Fixed by #64446
Assignees
Labels
Feature new functionality including changes to functionality and code refactors, etc.

Comments

@ITJamie
Copy link
Contributor

ITJamie commented Aug 31, 2022

Is your feature request related to a problem? Please describe.
Knowing if salt the current salt build is onedir/singlebin or system python based would be useful in certain states

Describe the solution you'd like
A grain that responds with "onedir","singlebin" or "system"

Describe alternatives you've considered
custom grain

Additional context
Add any other context or screenshots about the feature request here.

@ITJamie ITJamie added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Aug 31, 2022
@OrangeDog
Copy link
Contributor

or pip-installed?

@lukasraska
Copy link
Contributor

FWIW we're currently using this in custom grain to determine whether Salt is Tiamat-bundled

def _is_tiamat():
    return getattr(sys, "frozen", False)

although that's not really the case, in practice it's enough for us

@ITJamie
Copy link
Contributor Author

ITJamie commented Aug 31, 2022

adding @Ch3LL as we talked about this in the past on slack

@Ch3LL Ch3LL self-assigned this Aug 31, 2022
@Ch3LL Ch3LL added this to the Sulphur v3006.0 milestone Aug 31, 2022
@OrangeDog
Copy link
Contributor

OrangeDog commented Sep 1, 2022

It would be very useful if it was in the --versions-report too.

@Ch3LL would you consider this for 3005.1? After 3006 it will be less useful if onedir becomes the only supported system.

@max-arnold
Copy link
Contributor

max-arnold commented Sep 2, 2022

I'm curious, what use-cases you have in mind for this grain? I.e. what would be done differently in your states or modules based on this grain?

An obvious one is the pythonexecutable grain that no longer points to a Python interpreter and needs to be used differently based on the package format. But it can be handled differently based on its value only

@OrangeDog
Copy link
Contributor

If salt is installed with classic packaging, then people probably want to use pkg.installed for additional dependencies. But if it's onedir then they need to use pip.installed instead.

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 22, 2022

Since this is a feature request, it would need to go into 3006 not a point release. There is still value in 3006 since there is still different ways to install Salt: pip install and installing from packages that OS's provide

@Ch3LL
Copy link
Contributor

Ch3LL commented Jun 9, 2023

I've added #64446 , but I have not been able to determine a way to programattically determine if Salt was installed and running from pip. I'm open to suggestions in the meantime while I continue to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants