Issue #2590 has been updated by Markus Roberts.
At a guess, it looks like d397f8's late loading:
def module_directories
- Puppet.settings.value(:modulepath, Puppet[:environment]).find_all
do |dir|
- FileTest.directory?(dir)
- end.collect do |dir|
- Dir.entries(dir)
+ # We have to require this late in the process because otherwise we
might have
+ # load order issues.
+ require 'puppet/node/environment'
+ Puppet::Node::Environment.new.modulepath.collect do |dir|
+ Dir.entries(dir).reject { |f| f =~ /^\./ }.collect { |f|
File.join(dir, f) }
end.flatten.collect { |d| [File.join(d, "plugins"), File.join(d,
"lib")] }.flatten.find_all do |d|
FileTest.directory?(d)
end
Thwarts ea584787's modulepath clearing (doesn't clear it 'cause it isn't loaded
yet).
@@ -494,7 +494,15 @@ class Puppet::Util::Settings
@sync.synchronize do # yay, thread-safe
@values[type][param] = value
@cache.clear
+
clearused
+
+ # Clear the list of environments, because they cache, at
least, the module path.
+ # We *could* preferentially just clear them if the modulepath
is changed,
+ # but we don't really know if, say, the vardir is changed and
the modulepath
+ # is defined relative to it. We need the defined? stuff
because of loading
+ # order issues.
+ Puppet::Node::Environment.clear if defined?(Puppet::Node) and
defined?(Puppet::Node::Environment)
end
----------------------------------------
Bug #2590: --modulepath ignored
http://projects.reductivelabs.com/issues/2590
Author: Thomas Bellman
Status: Re-opened
Priority: High
Assigned to: James Turnbull
Category:
Target version: 0.25.2
Affected version: 0.25.1
Keywords:
Branch:
It seems that at least the stand-alone 'puppet' executable
ignores --modulepath. Given the following minimal manifest
set:
<pre>
$ pwd
/config/0.25
$ find . -type f -print
./manifests/site.pp
./modules/testmodule/manifests/init.pp
$ cat manifests/site.pp
import "testmodule"
node default
{
include moduleclass
}
$ cat modules/testmodule/manifests/init.pp
class moduleclass
{
file {
"/tmp/testfile":
ensure => file, content => "${puppetversion}\n";
}
}
</pre>
I get the following results:
<pre>
# puppet --modulepath=/config/0.25/modules manifests/site.pp
Could not parse for environment production: No file(s) found for
import of 'testmodule' at /config/0.25/manifests/site.pp:3
</pre>
This works as expected in 0.24.8. Bisecting shows that it was
introduced with commit d397f8d1d1092067f7ca52449ce9af63f02f44e1
(Fixing #2574 - autoloading finds plugins in modules) on
2009-09-01 01:01:17.
I have only tried the stand-alone puppet program, not the puppetd
/ puppetmasterd combination.
Adding --debug --trace I get the following traceback:
<pre>
/usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_support.rb:172:in `import'
grammar.ra:639:in `_reduce_156'
grammar.ra:638:in `each'
grammar.ra:638:in `_reduce_156'
/usr/lib/ruby/site_ruby/1.8/facter/util/ip.rb:141:in `_racc_yyparse_c'
/usr/lib/ruby/site_ruby/1.8/facter/util/ip.rb:141:in `catch'
/usr/lib/ruby/site_ruby/1.8/facter/util/ip.rb:141:in `_racc_yyparse_c'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/lexer.rb:446:in `scan'
/usr/lib/ruby/1.8/racc/parser.rb:152:in `_racc_yyparse_c'
/usr/lib/ruby/1.8/racc/parser.rb:152:in `__send__'
/usr/lib/ruby/1.8/racc/parser.rb:152:in `yyparse'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/parser_support.rb:430:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/interpreter.rb:71:in
`create_parser'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/interpreter.rb:54:in `parser'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/interpreter.rb:27:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:88:in
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:181:in `benchmark'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:86:in
`compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:35:in
`find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:198:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:51:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:116:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/bin/puppet:71
Could not parse for environment production: No file(s) found for import of
'testmodule' at /config/0.25/manifests/site.pp:3
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---