diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-07 06:47:10 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-07 06:47:10 +0000 |
commit | d4031312ecddc6fab15b5bc9693b8af0a23a57b8 (patch) | |
tree | ba48576ea294a4a72201a18e093bca4d6ce1537d /lib/puppet/provider/nameservice.rb | |
parent | f6f72f2288e3e3427abf0883a7ec507becc90f08 (diff) | |
download | puppet-d4031312ecddc6fab15b5bc9693b8af0a23a57b8.tar.gz puppet-d4031312ecddc6fab15b5bc9693b8af0a23a57b8.tar.xz puppet-d4031312ecddc6fab15b5bc9693b8af0a23a57b8.zip |
Merging the state-rename branch. This includes the diff from version 2156 to 2168. All states should now be properties, with backward compatibility for the types that restricted themselves to the methods.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2169 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/provider/nameservice.rb')
-rw-r--r-- | lib/puppet/provider/nameservice.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/provider/nameservice.rb b/lib/puppet/provider/nameservice.rb index dc4aadcc9..377393973 100644 --- a/lib/puppet/provider/nameservice.rb +++ b/lib/puppet/provider/nameservice.rb @@ -24,7 +24,7 @@ class Puppet::Provider::NameService < Puppet::Provider objects = [] listbyname do |name| obj = nil - check = model.validstates + check = model.validproperties if obj = model[name] obj[:check] = check else @@ -119,8 +119,8 @@ class Puppet::Provider::NameService < Puppet::Provider private - def op(state) - @ops[state.name] || ("-" + state.name) + def op(property) + @ops[property.name] || ("-" + property.name) end end @@ -202,7 +202,7 @@ class Puppet::Provider::NameService < Puppet::Provider return nil end - # again, needs to be set by the ind. state or its + # again, needs to be set by the ind. property or its # parent cmd = self.deletecmd type = "delete" @@ -293,7 +293,7 @@ class Puppet::Provider::NameService < Puppet::Provider # Convert the Etc struct into a hash. def info2hash(info) hash = {} - self.class.model.validstates.each do |param| + self.class.model.validproperties.each do |param| method = posixmethod(param) if info.respond_to? method hash[param] = info.send(posixmethod(param)) @@ -313,10 +313,10 @@ class Puppet::Provider::NameService < Puppet::Provider def method_missing(name, *args) name = name.to_s - # Make sure it's a valid state. We go up our class structure instead of + # Make sure it's a valid property. We go up our class structure instead of # our model's because the model is fake during testing. - unless self.class.model.validstate?(name.sub("=",'')) - raise Puppet::DevError, "%s is not a valid %s state" % + unless self.class.model.validproperty?(name.sub("=",'')) + raise Puppet::DevError, "%s is not a valid %s property" % [name, @model.class.name] end |