From 6c0d4259526c3ccf7c5c88e60f1b7b4f2ddc6717 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?=
Date: Tue, 1 Jul 2014 01:12:11 +0100
Subject: [PATCH] allow yumrepo proxy attribute to be set to _none_
Backport https://github.com/puppetlabs/puppet/pull/2767
Resolves rhbz#1114723
---
puppet.spec | 7 +++++-
yum_proxy_none_.patch | 50 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 yum_proxy_none_.patch
diff --git a/puppet.spec b/puppet.spec
index 35a52dd..9ff1c22 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -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 - 3.6.2-2
+- Allow yumrepo proxy attribute to be set to _none_
+
* Mon Jun 16 2014 Orion Poplawski - 3.6.2-1
- Update to 3.6.2
diff --git a/yum_proxy_none_.patch b/yum_proxy_none_.patch
new file mode 100644
index 0000000..30416e3
--- /dev/null
+++ b/yum_proxy_none_.patch
@@ -0,0 +1,50 @@
+From 973c58057d1bb24d64c716e2971d5317f6e0edfb Mon Sep 17 00:00:00 2001
+From: Graham Taylor
+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
+