summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-07-08 10:09:47 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-07-08 10:09:47 -0700
commit3cc09811cae1b263c0f94c78619b9e195c3d6bf9 (patch)
tree4eecdec689669657d9552fb2069d81c4888204bd /lib
parent726274322ceecf7adf6affe378b15af39abdf8f4 (diff)
parentfaf8a5c05f50d98835a1db05b96146618f485a04 (diff)
Merge branch 'ticket/master/7581-windows-feature-detection-error-message'
* ticket/master/7581-windows-feature-detection-error-message: (#7581) Provide more detailed error message when missing gems on Windows
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/feature/base.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb
index c983f5c12..9ed3deef5 100644
--- a/lib/puppet/feature/base.rb
+++ b/lib/puppet/feature/base.rb
@@ -43,7 +43,15 @@ Puppet.features.add(:posix) do
end
# We can use Microsoft Windows functions
-Puppet.features.add(:microsoft_windows, :libs => ["sys/admin", "win32/process", "win32/dir"])
+Puppet.features.add(:microsoft_windows) do
+ begin
+ require 'sys/admin'
+ require 'win32/process'
+ require 'win32/dir'
+ rescue LoadError => err
+ warn "Cannot run on Microsoft Windows without the sys-admin, win32-process & win32-dir gems: #{err}" unless Puppet.features.posix?
+ end
+end
raise Puppet::Error,"Cannot determine basic system flavour" unless Puppet.features.posix? or Puppet.features.microsoft_windows?