summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-10 03:24:05 +0000
committerlutter <lutter@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-10 03:24:05 +0000
commit5836c2340bd09eebc5a59fce408ae0d535b07f6f (patch)
tree67a798df446368d66561f684b823237032cb4a0b
parenta676e082433611c733c646dc0ebc52db47d51255 (diff)
downloadpuppet-5836c2340bd09eebc5a59fce408ae0d535b07f6f.tar.gz
puppet-5836c2340bd09eebc5a59fce408ae0d535b07f6f.tar.xz
puppet-5836c2340bd09eebc5a59fce408ae0d535b07f6f.zip
Allow listing of yumrepos
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2067 980ebf18-57e1-0310-9a29-db15c13687c0
-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?