Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

(PUP-1776) Load type requires properly on puppet master #3

Merged
merged 1 commit into from Mar 4, 2014

Conversation

Projects
None yet
3 participants
Contributor

ferventcoder commented Feb 27, 2014

This ensures that when the type is loaded, we use a relative path to the
required files. Currently there are failure messages on the puppet master
when it loads the type because it doesn't add the individual module lib
directories to the LOAD__PATH.

Contributor

peterhuene commented Feb 28, 2014

Do we need to fix these requires as well?

  • provider/acl/windows/base.rb:5
  • provider/acl/windows.rb:8
  • provider/acl/windows.rb:9
Contributor

ferventcoder commented Feb 28, 2014

@joshcooper See question above. It is my understanding that the master doesn't try to load the provider since it is Windows. Is it good practice to always use relative path with respect to modules?

I hadn't seen it in others like Reboot, so I'm assuming no, but wanted to check with Josh. :)

Member

joshcooper commented Feb 28, 2014

So the master ends up loading all of the types, and each type ends up requiring all of its providers. It appears it only does this to figure out what the default provider is for each type. https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type.rb#L1816

And this is why we have to do this sort of thing: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb#L3-L6

We hope to change this behavior real-soon-now, to ensure that provider code is never loaded on the master, but we're not there yet. So unfortunately windows modules need to protect themselves when running on non-windows masters.

As far as relative paths, the master doesn't add modules' lib directories to its LOAD_PATH, because the set of modules can vary from one environment to the next. IOW, the master needs to compile the catalog based on the environment the agent is in. So the best thing for now is to use relative paths in any code that may be required on the master.

Contributor

ferventcoder commented Feb 28, 2014

So, this would be a yes on the rest of the provider stuff then?

Contributor

peterhuene commented Mar 3, 2014

I believe so.

Contributor

ferventcoder commented Mar 4, 2014

I will fix this up today.

(PUP-1776) Load type requires properly on puppet master
This ensures that when the type is loaded, we use a relative path to the
required files. Currently there are failure messages on the puppet master
when it loads the type because it doesn't add the individual module lib
directories to the LOAD__PATH.

peterhuene added a commit that referenced this pull request Mar 4, 2014

Merge pull request #3 from ferventcoder/ticket/master/PUP-1776_load_t…
…ype_on_master

(PUP-1776) Load type requires properly on puppet master

@peterhuene peterhuene merged commit f35d71e into puppetlabs:master Mar 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment