From: Nathan Norton <[email protected]>

Signed-off-by: Nathan Norton <[email protected]>
---
Local-branch: feature/master/2247-enablerepo
 lib/puppet/provider/package/yum.rb |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/lib/puppet/provider/package/yum.rb 
b/lib/puppet/provider/package/yum.rb
index ab452cd..f67f6e8 100755
--- a/lib/puppet/provider/package/yum.rb
+++ b/lib/puppet/provider/package/yum.rb
@@ -86,8 +86,20 @@ Puppet::Type.type(:package).provide :yum, :parent => :rpm, 
:source => :rpm do
     self.debug "Ensuring => #{should}"
     wanted = @resource[:name]
     operation = :install
-    enablerepo = @resource[:enablerepo]
+
+    fulldisablerepo = []
     disablerepo= @resource[:disablerepo]
+    disablerepo.each do |value|
+      fulldisablerepo += [ " --disablerepo=" + value ]
+    end 
+    
+    
+    fullenablerepo  = []
+    enablerepo = @resource[:enablerepo]
+    enablerepo.each do |value|
+      fullenablerepo += [ " --enablerepo=" + value ]
+    end      
+    
 
     # XXX: We don't actually deal with epochs here.
     case should
@@ -104,18 +116,12 @@ Puppet::Type.type(:package).provide :yum, :parent => 
:rpm, :source => :rpm do
       end
     end
 
-    fullenablerepo = []
-    enablerepo.each do |value|
-      fullenablerepo += [ "--enablerepo=" + value ]
-    end
-
-    fulldisablerepo = []
-    disablerepo.each do |value|
-      disablerepo += [ "--disablerepo=" + value ]
+    if fullenablerepo == [] and fulldisablerepo == [] 
+      output = yum "-d", "0", "-e", "0", "-y", operation, wanted
+    else 
+      output = yum "-d", "0", "-e", "0", "-y", fulldisablerepo, 
fullenablerepo, operation, wanted
     end
 
-    output = yum "-d", "0", "-e", "0", "-y", fulldisablerepo, fullenablerepo, 
operation, wanted
-
     is = self.query
     raise Puppet::Error, "Could not find package #{self.name}" unless is
 
-- 
1.7.3.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to