You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
puppet/yum_proxy_none_.patch

51 lines
1.5 KiB

From 973c58057d1bb24d64c716e2971d5317f6e0edfb Mon Sep 17 00:00:00 2001
From: Graham Taylor <graham.x.taylor@capgemini.com>
Date: Fri, 13 Jun 2014 14:56:14 +0100
Subject: [PATCH] (PUP-2271) Allow yumrepo proxy attribute to be set to _none_
Add fix and test to allow proxy to be set to _none_ to bypass global proxy
configuration for YUM.
See https://tickets.puppetlabs.com/browse/PUP-2271
---
lib/puppet/type/yumrepo.rb | 2 +-
spec/unit/type/yumrepo_spec.rb | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
mode change 100644 => 100755 spec/unit/type/yumrepo_spec.rb
diff --git a/lib/puppet/type/yumrepo.rb b/lib/puppet/type/yumrepo.rb
index daa8d44..d9ff11d 100644
--- a/lib/puppet/type/yumrepo.rb
+++ b/lib/puppet/type/yumrepo.rb
@@ -277,7 +277,7 @@
newvalues(/.*/, :absent)
validate do |value|
- next if value.to_s == 'absent'
+ next if value.to_s =~ /^(absent|_none_)$/
parsed = URI.parse(value)
unless VALID_SCHEMES.include?(parsed.scheme)
diff --git a/spec/unit/type/yumrepo_spec.rb b/spec/unit/type/yumrepo_spec.rb
old mode 100644
new mode 100755
index 543a0ce..2246b72
--- a/spec/unit/type/yumrepo_spec.rb
+++ b/spec/unit/type/yumrepo_spec.rb
@@ -295,6 +295,12 @@
describe "proxy" do
it_behaves_like "a yumrepo parameter that can be absent", :proxy
+ it "accepts _none_" do
+ described_class.new(
+ :name => 'puppetlabs',
+ :proxy => "_none_"
+ )
+ end
it_behaves_like "a yumrepo parameter that accepts a single URL", :proxy
end
--
1.9.3