Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

.../site-packages/salt/modules/ has priority over _modules #780

Closed
blast-hardcheese opened this Issue · 19 comments

5 participants

@blast-hardcheese

Not sure if this is intentional, but it took me a while to figure out what was going on. Turns out I had an old version of my module in site-packages/salt/modules/, very frustrating.

Thoughts?

@SEJeff
Owner

I would think that the system installed modules should override custom modules otherwise you could (potentially) run into issues when you override builtin salt modules accidentally and things start subtly breaking.

What do you think?

@thatch45
Owner

If I recall my intentions, it was that the _modules overrode the system modules, I thought this was the behavior, but it seems that blast was running into problems here.

Regardless of what we choose, it needs to be clean, deterministic and documented

@blast-hardcheese

I can see advantages on both sides, I think _modules should override the builtin modules, but maybe this could be a /etc/salt/minion configuration option? I think using system modules, states, etc over custom ones should be the default, but we should have a way to do that. It would make developing extensions to existing system modules /much/ easier.

@SEJeff
Owner

Sounds reasonable to me.

@dcolish

My votes for having _modules always override. I'm not sure about making this configurable since they're just python modules and there is already a good system for managing those.

@blast-hardcheese
@thatch45
Owner

yes, _modules should allow you to override or add to an existing module, logging this event would not be a bad idea

@blast-hardcheese

SEJeff, Before I try and make this happen, any thoughts?

@thatch45
Owner

This should only require making sure the loader is bringing thing up in the right order, look at loader.py

@SEJeff
Owner

@blast-hardcheese Consensus wins. So long as this behavior is enforced AND documented works for me. Salt is only as strong as it's community.

@blast-hardcheese

I asked in channel, but just in case I'm AFK when someone sees it, I'm asking again here. I made the required modification to loader.py, but then noticed that render and grains could be refactored to also use _create_loader. Anyway, comments welcome: loader_restructure

@thatch45
Owner

I like it blast! The only thing I would change is that we use .format to manage strings, but I like the modification and the fact that it unifies the loading interface, thanks!

@SEJeff
Owner

@blast-hardcheese Nice! When you're done, would you mind unifying it all like you said?

@blast-hardcheese

@thatch45: Changed string formatting to .format

@SEJeff: Sorry, memory might be faulty here; what are you referring to?

@thatch45
Owner

Thanks blast, I am excited to get this pull req!

@SEJeff
Owner

@blast-hardcheese disregard, I'm a bit loopy from working 12 hours yesterday and a 5-6 today for $real_job. Just a bit out of it I guess.

@blast-hardcheese

@SEJeff No worries!

Closed out with f8d3bf8

@akatrevorjay

This appears to still be happening for me on 0.15.1?

@thatch45
Owner

Odd, you are sure the module is being distributed to the minion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.