allow yumrepo proxy attribute to be set to _none_

Backport https://github.com/puppetlabs/puppet/pull/2767
Resolves rhbz#1114723
epel9
Pádraig Brady 11 years ago
parent 392e745c60
commit 6c0d425952

@ -16,7 +16,7 @@
Name: puppet
Version: 3.6.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A network tool for managing many disparate systems
License: ASL 2.0
URL: http://puppetlabs.com
@ -25,6 +25,7 @@ Source1: http://downloads.puppetlabs.com/%{name}/%{name}-%{version}.tar.g
Source2: puppet-nm-dispatcher
Source3: puppet-nm-dispatcher.systemd
Source4: start-puppet-wrapper
Patch0: yum_proxy_none_.patch
Group: System Environment/Base
@ -104,6 +105,7 @@ The server can also function as a certificate authority and file server.
%prep
%setup -q
%patch0 -p1
chmod +x ext/puppet-load.rb ext/regexp_nodes/regexp_nodes.rb
%build
@ -386,6 +388,9 @@ exit 0
rm -rf %{buildroot}
%changelog
* Mon Jun 30 2014 Pádraig Brady <pbrady@redhat.com> - 3.6.2-2
- Allow yumrepo proxy attribute to be set to _none_
* Mon Jun 16 2014 Orion Poplawski <orion@cora.nwra.com> - 3.6.2-1
- Update to 3.6.2

@ -0,0 +1,50 @@
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
Loading…
Cancel
Save