From 5836c2340bd09eebc5a59fce408ae0d535b07f6f Mon Sep 17 00:00:00 2001 From: lutter Date: Wed, 10 Jan 2007 03:24:05 +0000 Subject: Allow listing of yumrepos git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2067 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/yumrepo.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb index 5c06edc57..5e99cf025 100644 --- a/lib/puppet/type/yumrepo.rb +++ b/lib/puppet/type/yumrepo.rb @@ -83,6 +83,26 @@ module Puppet # Where to put files for brand new sections @defaultrepodir = nil + def self.list + l = [] + check = validstates + inifile.each_section do |s| + next if s.name == "main" + obj = create(:name => s.name, :check => check) + obj.retrieve + obj.eachstate do |state| + if state.is.nil? + obj.delete(state.name) + else + state.should = state.is + end + end + obj.delete(:check) + l << obj + end + l + end + # Return the Puppet::IniConfig::File for the whole yum config def self.inifile if @inifile.nil? -- cgit