Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Get default saltenv from minion config [enhancement] #5

Open
dkacar-oradian opened this issue Nov 6, 2020 · 4 comments
Open

Get default saltenv from minion config [enhancement] #5

dkacar-oradian opened this issue Nov 6, 2020 · 4 comments

Comments

@dkacar-oradian
Copy link

I'm using saltenv and pillarenv different from base for my development servers, so every time I'd have to specify saltenv manually, which is rather tedious.

My servers have saltenv in the minion config which means that their default saltenv will be present in __opts__. I don't know if there are other ways to configure default saltenv for a minion.

So the code could look like this:

def render(..., saltenv=None, ...):
   """
   docstring
   """
   if saltenv is None:
      saltenv = __opts__.get('saltenv', 'base')
   ...

That would work for me. But again, I'm not sure if that's a 100% reliable way to obtain the default saltenv for a minion.

@whytewolf
Copy link
Owner

I'll be honest I didn't know anyone still uses this I haven't updated it for a while since slsutil.renderer actually does most of what this does.

I"ll see when I get some free time about doing some tweaks to get saltenv picked up from the config.

@dkacar-oradian
Copy link
Author

I just found this today. I still didn't try to use it. :-)

@whytewolf
Copy link
Owner

most likely what will happen is I depreciate the rendering part and just point to slsutil.renderer but keep the YAML linter functionality.

@dkacar-oradian
Copy link
Author

That's perfectly reasonable. Although you might want to rename the module. debug has a rather high probability of collision with someone else's debug module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants