diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 21:29:08 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 21:29:08 +0000 |
| commit | 60ea7d2a9df65f3c2ed492ec4447420c5e5151fe (patch) | |
| tree | de99ac27de31df3cadc4b721406b579404106d9c /lib/puppet/util | |
| parent | 3d17685f9954b584cf84a6fe224b2513007108f0 (diff) | |
| download | puppet-60ea7d2a9df65f3c2ed492ec4447420c5e5151fe.tar.gz puppet-60ea7d2a9df65f3c2ed492ec4447420c5e5151fe.tar.xz puppet-60ea7d2a9df65f3c2ed492ec4447420c5e5151fe.zip | |
Fixing #432 - you can now manage home dirs with users. You cannot yet purge home directories, because there is still controversy over how that should be done. Also, allowdupe is now handled like a feature, which is, um, better.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2328 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/util')
| -rw-r--r-- | lib/puppet/util/provider_features.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/puppet/util/provider_features.rb b/lib/puppet/util/provider_features.rb index fbf2260dd..773f0ec98 100644 --- a/lib/puppet/util/provider_features.rb +++ b/lib/puppet/util/provider_features.rb @@ -12,11 +12,18 @@ module Puppet::Util::ProviderFeatures # Are all of the requirements met? def available?(obj) - if self.methods and ! methods_available?(obj) + if self.methods + if methods_available?(obj) + return true + else + return false + end + else + # In this case, the provider has to declare support for this + # feature, and that's been checked before we ever get to the + # method checks. return false end - - true end def initialize(name, docs, hash) @@ -44,7 +51,7 @@ module Puppet::Util::ProviderFeatures # Define one or more features. At a minimum, features require a name # and docs, and at this point they should also specify a list of methods # required to determine if the feature is present. - def feature(name, docs, hash) + def feature(name, docs, hash = {}) @features ||= {} if @features.include?(name) raise Puppet::DevError, "Feature %s is already defined" % name |
