summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/type/yumrepo.rb20
1 files changed, 20 insertions, 0 deletions
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?