Please review pull request #705: Skip pluginsync in puppet apply if no modulepath opened by (pcarlisle)

Description:

If the modulepath contains no existing directories, skip pluginsync

  • Opened: Tue Apr 24 17:43:18 UTC 2012
  • Based on: puppetlabs:master (54e1c83afde1b721e5433adea17a4dd0caffbc63)
  • Requested merge: pcarlisle:pluginsync-error (5fddc946259eb1a1569cabddce01b3c88fe7357b)

Diff follows:

diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index fe37f3a..647bba5 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -272,6 +272,15 @@ def read_catalog(text)
   def apply_catalog(catalog)
     require 'puppet/configurer'
     configurer = Puppet::Configurer.new
-    configurer.run(:catalog => catalog)
+    options = {:catalog => catalog}
+
+    # If we run pluginsync without a valid modulepath it causes confusing
+    # errors, better to complain clearly now and skip it
+    if Puppet::Node::Environment.new.modulepath.empty?
+      Puppet.warning "No valid modulepath found, skipping pluginsync"
+      options.merge!(:skip_plugin_download => true)
+    end
+
+    configurer.run(options)
   end
 end

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.

Reply via email to