[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08
James Turnbull
james at lovedthanlost.net
Fri Jan 15 09:07:29 UTC 2010
The following commit has been merged in the upstream branch:
commit 3abcc896c84e1cd1c68fcb661c69090872294868
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date: Thu Nov 26 19:58:39 2009 +0100
Fix #2783, take2 - puppetdoc should use environment to get modulepath/manifestdir
I was told that setting manifestdir in environment is not supported.
Only the manifest setting seems to be supported in environments.
This patch changes how puppetdoc handles manifestdir, instead
of getting it through the manifestdir variable, we now get the
manifest settings and infer the directory from this, exactly as
the parser is doing.
This allows puppetdoc to handle what user are doing with environments.
Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>
diff --git a/lib/puppet/application/puppetdoc.rb b/lib/puppet/application/puppetdoc.rb
index 0a4e0c3..e003327 100644
--- a/lib/puppet/application/puppetdoc.rb
+++ b/lib/puppet/application/puppetdoc.rb
@@ -68,7 +68,7 @@ Puppet::Application.new(:puppetdoc) do
unless @manifest
env = Puppet::Node::Environment.new
files += env.modulepath
- files += env.manifestdir
+ files << File.dirname(env[:manifest])
end
files += ARGV
Puppet.info "scanning: %s" % files.inspect
diff --git a/spec/unit/application/puppetdoc.rb b/spec/unit/application/puppetdoc.rb
index cb60581..413fa11 100755
--- a/spec/unit/application/puppetdoc.rb
+++ b/spec/unit/application/puppetdoc.rb
@@ -293,7 +293,7 @@ describe "puppetdoc" do
@env = stub 'env'
Puppet::Node::Environment.stubs(:new).returns(@env)
@env.stubs(:modulepath).returns(['modules'])
- @env.stubs(:manifestdir).returns(['manifests'])
+ @env.stubs(:[]).with(:manifest).returns('manifests/site.pp')
@puppetdoc.options.stubs(:[]).with(:all).returns(false)
@puppetdoc.options.stubs(:[]).with(:outputdir).returns('doc')
Puppet.settings.stubs(:[]=).with(:document_all, false)
@@ -334,9 +334,9 @@ describe "puppetdoc" do
it "should get modulepath and manifestdir values from the environment" do
@env.expects(:modulepath).returns(['envmodules1','envmodules2'])
- @env.expects(:manifestdir).returns(['envmanifests1','envmanifests2'])
+ @env.expects(:[]).with(:manifest).returns('envmanifests/site.pp')
- Puppet::Util::RDoc.expects(:rdoc).with('doc', ['envmodules1','envmodules2','envmanifests1','envmanifests2'])
+ Puppet::Util::RDoc.expects(:rdoc).with('doc', ['envmodules1','envmodules2','envmanifests'])
@puppetdoc.rdoc
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list