diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-08-24 15:42:03 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-08-24 15:42:03 -0700 |
| commit | da4a2def42639817c4522fc0162bd691956998da (patch) | |
| tree | 3cb423a7d2a7a803a922b710c661d675d11bf131 /lib/puppet/feature | |
| parent | 0d51dc9be0bc1c785d749b8b352a1e43b1b6e9c6 (diff) | |
| parent | 630ec36089e2224fba99b76d76eaf904af13e4d6 (diff) | |
| download | puppet-da4a2def42639817c4522fc0162bd691956998da.tar.gz puppet-da4a2def42639817c4522fc0162bd691956998da.tar.xz puppet-da4a2def42639817c4522fc0162bd691956998da.zip | |
Merge branch '2.7.x'
Conflicts:
lib/puppet/feature/base.rb
lib/puppet/file_serving/configuration.rb
spec/unit/indirector/ssl_file_spec.rb
spec/unit/parser/functions/extlookup_spec.rb
spec/unit/resource/catalog_spec.rb
test/language/ast/variable.rb
Diffstat (limited to 'lib/puppet/feature')
| -rw-r--r-- | lib/puppet/feature/base.rb | 57 | ||||
| -rw-r--r-- | lib/puppet/feature/rails.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/feature/rubygems.rb | 3 |
3 files changed, 28 insertions, 35 deletions
diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb index b1988278e..cecc1b9ad 100644 --- a/lib/puppet/feature/base.rb +++ b/lib/puppet/feature/base.rb @@ -1,10 +1,35 @@ -# Created by Luke Kanies on 2006-04-30. -# Copyright (c) 2006. All rights reserved. - require 'puppet/util/feature' # Add the simple features, all in one file. +# Order is important as some features depend on others + +# We have a syslog implementation +Puppet.features.add(:syslog, :libs => ["syslog"]) + +# We can use POSIX user functions +Puppet.features.add(:posix) do + require 'etc' + Etc.getpwuid(0) != nil && Puppet.features.syslog? +end + +# We can use Microsoft Windows functions +Puppet.features.add(:microsoft_windows) do + begin + require 'sys/admin' + require 'win32/process' + require 'win32/dir' + require 'win32/service' + require 'win32ole' + require 'win32/api' + true + rescue LoadError => err + warn "Cannot run on Microsoft Windows without the sys-admin, win32-process, win32-dir & win32-service 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? + # We've got LDAP available. Puppet.features.add(:ldap, :libs => ["ldap"]) @@ -33,32 +58,6 @@ Puppet.features.add(:rrd, :libs => ["RRD"]) # We have OpenSSL Puppet.features.add(:openssl, :libs => ["openssl"]) -# We have a syslog implementation -Puppet.features.add(:syslog, :libs => ["syslog"]) - -# We can use POSIX user functions -Puppet.features.add(:posix) do - require 'etc' - Etc.getpwuid(0) != nil && Puppet.features.syslog? -end - -# We can use Microsoft Windows functions -Puppet.features.add(:microsoft_windows) do - begin - require 'sys/admin' - require 'win32/process' - require 'win32/dir' - require 'win32/service' - require 'win32ole' - require 'win32/api' - true - rescue LoadError => err - warn "Cannot run on Microsoft Windows without the sys-admin, win32-process, win32-dir & win32-service 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? - # We have CouchDB Puppet.features.add(:couchdb, :libs => ["couchrest"]) diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb index 74ed09aa6..fe5cb0f8a 100644 --- a/lib/puppet/feature/rails.rb +++ b/lib/puppet/feature/rails.rb @@ -1,6 +1,3 @@ -# Created by Luke Kanies on 2006-11-07. -# Copyright (c) 2006. All rights reserved. - require 'puppet/util/feature' Puppet.features.rubygems? diff --git a/lib/puppet/feature/rubygems.rb b/lib/puppet/feature/rubygems.rb index 639524ffe..7cfbbc6d3 100644 --- a/lib/puppet/feature/rubygems.rb +++ b/lib/puppet/feature/rubygems.rb @@ -1,6 +1,3 @@ -# Created by Luke Kanies on 2006-11-07. -# Copyright (c) 2006. All rights reserved. - require 'puppet/util/feature' Puppet.features.add(:rubygems, :libs => "rubygems") |
