summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider/nameservice.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-08 17:20:00 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-06-08 17:20:00 +0000
commit73502a7cac443890792ffd9d3bb4778a90413e61 (patch)
tree77ba7aa23d82a21b4bdfb9c135ceba086795b449 /lib/puppet/provider/nameservice.rb
parentbf82d51737df7509faf4601dbbf15b265bd9da3d (diff)
downloadpuppet-73502a7cac443890792ffd9d3bb4778a90413e61.tar.gz
puppet-73502a7cac443890792ffd9d3bb4778a90413e61.tar.xz
puppet-73502a7cac443890792ffd9d3bb4778a90413e61.zip
Finishing off the type/provider interface work, including adding package prefetch for all packages. The only not-done one is yum -- prefetch is set up for rpm, but not yum. We need to modify prefetching so that it also prefetches latest information, to avoid having to run yum so many times.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2555 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/provider/nameservice.rb')
-rw-r--r--lib/puppet/provider/nameservice.rb16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/puppet/provider/nameservice.rb b/lib/puppet/provider/nameservice.rb
index 8e01bfe21..bc205d43a 100644
--- a/lib/puppet/provider/nameservice.rb
+++ b/lib/puppet/provider/nameservice.rb
@@ -25,22 +25,10 @@ class Puppet::Provider::NameService < Puppet::Provider
super
end
- def list
+ def instances
objects = []
listbyname do |name|
- obj = nil
- check = resource_type.validproperties
- if obj = resource_type[name]
- obj[:check] = check
- else
- # unless it exists, create it as an unmanaged object
- obj = resource_type.create(:name => name, :check => check)
- end
-
- next unless obj # In case there was an error somewhere
-
- objects << obj
- yield obj if block_given?
+ objects << new(:name => name, :ensure => :present)
end
objects