[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:13 UTC 2010


The following commit has been merged in the upstream branch:
commit 6c2daa36ded879763cfc1a6fac8f4e6d75a3cadb
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Wed Nov 11 20:25:28 2009 +0100

    Fix #2783 - Puppetdoc rdoc should use environment to get modulepath/manifestdir
    
    Puppetdoc wasn't using the current environment to find the correct
    modulepath and manifestdir.
    
    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 a5496cc..5656112 100644
--- a/lib/puppet/application/puppetdoc.rb
+++ b/lib/puppet/application/puppetdoc.rb
@@ -66,8 +66,9 @@ Puppet::Application.new(:puppetdoc) do
         exit_code = 0
         files = []
         unless @manifest
-            files += Puppet[:modulepath].split(':').collect { |p| File.expand_path(p) }
-            files += Puppet[:manifestdir].split(':').collect { |p| File.expand_path(p) }
+            env = Puppet::Node::Environment.new
+            files += env.modulepath
+            files += env.manifestdir
         end
         files += ARGV
         Puppet.info "scanning: %s" % files.inspect
diff --git a/spec/unit/application/puppetdoc.rb b/spec/unit/application/puppetdoc.rb
index b917375..cb60581 100755
--- a/spec/unit/application/puppetdoc.rb
+++ b/spec/unit/application/puppetdoc.rb
@@ -290,16 +290,16 @@ describe "puppetdoc" do
                 @puppetdoc.manifest = false
                 Puppet.stubs(:info)
                 Puppet.stubs(:[]).with(:trace).returns(false)
-                Puppet.stubs(:[]).with(:modulepath).returns('modules')
-                Puppet.stubs(:[]).with(:manifestdir).returns('manifests')
+                @env = stub 'env'
+                Puppet::Node::Environment.stubs(:new).returns(@env)
+                @env.stubs(:modulepath).returns(['modules'])
+                @env.stubs(:manifestdir).returns(['manifests'])
                 @puppetdoc.options.stubs(:[]).with(:all).returns(false)
                 @puppetdoc.options.stubs(:[]).with(:outputdir).returns('doc')
                 Puppet.settings.stubs(:[]=).with(:document_all, false)
                 Puppet.settings.stubs(:setdefaults)
                 Puppet::Util::RDoc.stubs(:rdoc)
                 @puppetdoc.stubs(:exit)
-                File.stubs(:expand_path).with('modules').returns('modules')
-                File.stubs(:expand_path).with('manifests').returns('manifests')
                 @old = ARGV.dup
                 ARGV.clear
             end
@@ -331,6 +331,15 @@ describe "puppetdoc" do
                 Puppet::Util::RDoc.expects(:manifestdoc)
                 @puppetdoc.rdoc
             end
+
+            it "should get modulepath and manifestdir values from the environment" do
+                @env.expects(:modulepath).returns(['envmodules1','envmodules2'])
+                @env.expects(:manifestdir).returns(['envmanifests1','envmanifests2'])
+
+                Puppet::Util::RDoc.expects(:rdoc).with('doc', ['envmodules1','envmodules2','envmanifests1','envmanifests2'])
+
+                @puppetdoc.rdoc
+            end
         end
 
         describe "in the other modes" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list