All of lore.kernel.org
 help / color / mirror / Atom feed
* [m-c-s][PATCH] puppet: back-port some patches to fix issues with Ruby >= 2.0.0
@ 2015-08-20 20:14 Mark Asselstine
  2015-08-21  2:56 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Asselstine @ 2015-08-20 20:14 UTC (permalink / raw)
  To: bruce.ashfield; +Cc: meta-virtualization

We should uprev puppet at some point but for the sake of stabilizing
first the following set of patches will allow puppet to work with the
newer version of Ruby that we are using.

The first two are upstream commits and the third is a commit which
borrows a fix found in various puppet forks (repos which people host
to stabalize older versions of puppet). With these patches puppet can
now execute commands like 'help' and 'apply' without falling over.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
 ...uplicate-key-which-ruby-2.2-complains-abo.patch | 30 ++++++++++++++++++
 ...aint-Change-spec-test-to-pass-on-ruby-2.2.patch | 37 ++++++++++++++++++++++
 ..._yaml-syck-isn-t-available-for-Ruby-2.0.0.patch | 35 ++++++++++++++++++++
 recipes-support/puppet/puppet_3.7.3.bb             |  3 ++
 4 files changed, 105 insertions(+)
 create mode 100644 recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
 create mode 100644 recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
 create mode 100644 recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch

diff --git a/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch b/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
new file mode 100644
index 0000000..696c642
--- /dev/null
+++ b/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
@@ -0,0 +1,30 @@
+From 05dad9b1d30a8ff1e8e4a06bc5eaf0b19dab43e2 Mon Sep 17 00:00:00 2001
+From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
+Date: Fri, 24 Jul 2015 20:18:08 +0200
+Subject: [PATCH] (MAINT) Fix duplicate key which ruby 2.2 complains about
+
+commit 05dad9b1d30a8ff1e8e4a06bc5eaf0b19dab43e2 from
+https://github.com/puppetlabs/puppet.git
+
+---
+ lib/puppet/defaults.rb | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
+index eeefefa..b591697 100644
+--- a/lib/puppet/defaults.rb
++++ b/lib/puppet/defaults.rb
+@@ -486,10 +486,6 @@ module Puppet
+       :default    => "stomp",
+       :desc       => "Which type of queue to use for asynchronous processing.",
+     },
+-    :queue_type => {
+-      :default    => "stomp",
+-      :desc       => "Which type of queue to use for asynchronous processing.",
+-    },
+     :queue_source => {
+       :default    => "stomp://localhost:61613/",
+       :desc       => "Which type of queue to use for asynchronous processing.  If your stomp server requires
+-- 
+2.1.4
+
diff --git a/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch b/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
new file mode 100644
index 0000000..73e1769
--- /dev/null
+++ b/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
@@ -0,0 +1,37 @@
+From d183826136ca77847da5f3e460f2e460faabc5be Mon Sep 17 00:00:00 2001
+From: Kylo Ginsberg <kylo@puppetlabs.com>
+Date: Mon, 22 Dec 2014 10:11:38 -0800
+Subject: [PATCH] (maint) Change spec test to pass on ruby 2.2
+
+commit d183826136ca77847da5f3e460f2e460faabc5be from
+https://github.com/puppetlabs/puppet.git
+
+Prior to this change, this spec test failed on ruby 2.2.0-rc1 with:
+
+     Failure/Error: Time.stubs(:now).returns(Time.parse("2011-01-06 12:00:00 UTC"))
+     NoMethodError:
+       undefined method `utc_offset' for nil:NilClass
+
+I didn't track down the root cause of this failure, but just
+normalized this stub to use Time.utc, which (along with Time.local)
+is the more common way of stubbing Time objects in the codebase.
+---
+ spec/unit/reports/store_spec.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb
+index 7f94f7d..f56eccd 100755
+--- a/spec/unit/reports/store_spec.rb
++++ b/spec/unit/reports/store_spec.rb
+@@ -24,7 +24,7 @@ describe processor do
+     end
+ 
+     it "should write the report to the file in YAML" do
+-      Time.stubs(:now).returns(Time.parse("2011-01-06 12:00:00 UTC"))
++      Time.stubs(:now).returns(Time.utc(2011,01,06,12,00,00))
+       @report.process
+ 
+       File.read(File.join(Puppet[:reportdir], @report.host, "201101061200.yaml")).should == @report.to_yaml
+-- 
+2.1.4
+
diff --git a/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch b/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch
new file mode 100644
index 0000000..1cd5e25
--- /dev/null
+++ b/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch
@@ -0,0 +1,35 @@
+From fca1579d62d5b978375511e062b9c18f4413dd5a Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Thu, 20 Aug 2015 14:06:32 -0400
+Subject: [PATCH] safe_yaml: syck isn't available for Ruby >= 2.0.0
+
+This change was taken from various puppet forks but does not exist in
+puppet upstream as they drop support for YAML on the network as part
+of work to fix PUP-3272.
+
+https://tickets.puppetlabs.com/browse/PUP-3272
+
+Community versions of this change:
+https://github.com/kylog/puppet/commit/42b2e77ec24dfbbf2317d08615a35127afbc4782
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb b/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
+index 8670ace..722dd3e 100644
+--- a/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
++++ b/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
+@@ -3,7 +3,7 @@ require "yaml"
+ # This needs to be defined up front in case any internal classes need to base
+ # their behavior off of this.
+ module SafeYAML
+-  YAML_ENGINE = defined?(YAML::ENGINE) ? YAML::ENGINE.yamler : "syck"
++  YAML_ENGINE = defined?(YAML::ENGINE) ? YAML::ENGINE.yamler : (defined?(Psych) && YAML == Psych ? "psych" : "syck")
+ end
+ 
+ require "set"
+-- 
+2.1.4
+
diff --git a/recipes-support/puppet/puppet_3.7.3.bb b/recipes-support/puppet/puppet_3.7.3.bb
index 14e18d9..3e8f869 100644
--- a/recipes-support/puppet/puppet_3.7.3.bb
+++ b/recipes-support/puppet/puppet_3.7.3.bb
@@ -7,6 +7,9 @@ SRC_URI = " \
     https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
     file://add_puppet_gemspec.patch \
     file://puppet.conf \
+    file://maint-Change-spec-test-to-pass-on-ruby-2.2.patch \
+    file://MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch \
+    file://safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch \
 "
 SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
 SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [m-c-s][PATCH] puppet: back-port some patches to fix issues with Ruby >= 2.0.0
  2015-08-20 20:14 [m-c-s][PATCH] puppet: back-port some patches to fix issues with Ruby >= 2.0.0 Mark Asselstine
@ 2015-08-21  2:56 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2015-08-21  2:56 UTC (permalink / raw)
  To: Mark Asselstine; +Cc: meta-virtualization

On 2015-08-20 4:14 PM, Mark Asselstine wrote:
> We should uprev puppet at some point but for the sake of stabilizing
> first the following set of patches will allow puppet to work with the
> newer version of Ruby that we are using.
>
> The first two are upstream commits and the third is a commit which
> borrows a fix found in various puppet forks (repos which people host
> to stabalize older versions of puppet). With these patches puppet can
> now execute commands like 'help' and 'apply' without falling over.
>

No reason to sit on this .. since it can't be worse than it currently
is.

merged to master.

Bruce


> Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> ---
>   ...uplicate-key-which-ruby-2.2-complains-abo.patch | 30 ++++++++++++++++++
>   ...aint-Change-spec-test-to-pass-on-ruby-2.2.patch | 37 ++++++++++++++++++++++
>   ..._yaml-syck-isn-t-available-for-Ruby-2.0.0.patch | 35 ++++++++++++++++++++
>   recipes-support/puppet/puppet_3.7.3.bb             |  3 ++
>   4 files changed, 105 insertions(+)
>   create mode 100644 recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
>   create mode 100644 recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
>   create mode 100644 recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch
>
> diff --git a/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch b/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
> new file mode 100644
> index 0000000..696c642
> --- /dev/null
> +++ b/recipes-support/puppet/puppet/MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch
> @@ -0,0 +1,30 @@
> +From 05dad9b1d30a8ff1e8e4a06bc5eaf0b19dab43e2 Mon Sep 17 00:00:00 2001
> +From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
> +Date: Fri, 24 Jul 2015 20:18:08 +0200
> +Subject: [PATCH] (MAINT) Fix duplicate key which ruby 2.2 complains about
> +
> +commit 05dad9b1d30a8ff1e8e4a06bc5eaf0b19dab43e2 from
> +https://github.com/puppetlabs/puppet.git
> +
> +---
> + lib/puppet/defaults.rb | 4 ----
> + 1 file changed, 4 deletions(-)
> +
> +diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
> +index eeefefa..b591697 100644
> +--- a/lib/puppet/defaults.rb
> ++++ b/lib/puppet/defaults.rb
> +@@ -486,10 +486,6 @@ module Puppet
> +       :default    => "stomp",
> +       :desc       => "Which type of queue to use for asynchronous processing.",
> +     },
> +-    :queue_type => {
> +-      :default    => "stomp",
> +-      :desc       => "Which type of queue to use for asynchronous processing.",
> +-    },
> +     :queue_source => {
> +       :default    => "stomp://localhost:61613/",
> +       :desc       => "Which type of queue to use for asynchronous processing.  If your stomp server requires
> +--
> +2.1.4
> +
> diff --git a/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch b/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
> new file mode 100644
> index 0000000..73e1769
> --- /dev/null
> +++ b/recipes-support/puppet/puppet/maint-Change-spec-test-to-pass-on-ruby-2.2.patch
> @@ -0,0 +1,37 @@
> +From d183826136ca77847da5f3e460f2e460faabc5be Mon Sep 17 00:00:00 2001
> +From: Kylo Ginsberg <kylo@puppetlabs.com>
> +Date: Mon, 22 Dec 2014 10:11:38 -0800
> +Subject: [PATCH] (maint) Change spec test to pass on ruby 2.2
> +
> +commit d183826136ca77847da5f3e460f2e460faabc5be from
> +https://github.com/puppetlabs/puppet.git
> +
> +Prior to this change, this spec test failed on ruby 2.2.0-rc1 with:
> +
> +     Failure/Error: Time.stubs(:now).returns(Time.parse("2011-01-06 12:00:00 UTC"))
> +     NoMethodError:
> +       undefined method `utc_offset' for nil:NilClass
> +
> +I didn't track down the root cause of this failure, but just
> +normalized this stub to use Time.utc, which (along with Time.local)
> +is the more common way of stubbing Time objects in the codebase.
> +---
> + spec/unit/reports/store_spec.rb | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb
> +index 7f94f7d..f56eccd 100755
> +--- a/spec/unit/reports/store_spec.rb
> ++++ b/spec/unit/reports/store_spec.rb
> +@@ -24,7 +24,7 @@ describe processor do
> +     end
> +
> +     it "should write the report to the file in YAML" do
> +-      Time.stubs(:now).returns(Time.parse("2011-01-06 12:00:00 UTC"))
> ++      Time.stubs(:now).returns(Time.utc(2011,01,06,12,00,00))
> +       @report.process
> +
> +       File.read(File.join(Puppet[:reportdir], @report.host, "201101061200.yaml")).should == @report.to_yaml
> +--
> +2.1.4
> +
> diff --git a/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch b/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch
> new file mode 100644
> index 0000000..1cd5e25
> --- /dev/null
> +++ b/recipes-support/puppet/puppet/safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch
> @@ -0,0 +1,35 @@
> +From fca1579d62d5b978375511e062b9c18f4413dd5a Mon Sep 17 00:00:00 2001
> +From: Mark Asselstine <mark.asselstine@windriver.com>
> +Date: Thu, 20 Aug 2015 14:06:32 -0400
> +Subject: [PATCH] safe_yaml: syck isn't available for Ruby >= 2.0.0
> +
> +This change was taken from various puppet forks but does not exist in
> +puppet upstream as they drop support for YAML on the network as part
> +of work to fix PUP-3272.
> +
> +https://tickets.puppetlabs.com/browse/PUP-3272
> +
> +Community versions of this change:
> +https://github.com/kylog/puppet/commit/42b2e77ec24dfbbf2317d08615a35127afbc4782
> +
> +Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
> +---
> + lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb b/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
> +index 8670ace..722dd3e 100644
> +--- a/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
> ++++ b/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb
> +@@ -3,7 +3,7 @@ require "yaml"
> + # This needs to be defined up front in case any internal classes need to base
> + # their behavior off of this.
> + module SafeYAML
> +-  YAML_ENGINE = defined?(YAML::ENGINE) ? YAML::ENGINE.yamler : "syck"
> ++  YAML_ENGINE = defined?(YAML::ENGINE) ? YAML::ENGINE.yamler : (defined?(Psych) && YAML == Psych ? "psych" : "syck")
> + end
> +
> + require "set"
> +--
> +2.1.4
> +
> diff --git a/recipes-support/puppet/puppet_3.7.3.bb b/recipes-support/puppet/puppet_3.7.3.bb
> index 14e18d9..3e8f869 100644
> --- a/recipes-support/puppet/puppet_3.7.3.bb
> +++ b/recipes-support/puppet/puppet_3.7.3.bb
> @@ -7,6 +7,9 @@ SRC_URI = " \
>       https://downloads.puppetlabs.com/puppet/puppet-${PV}.tar.gz \
>       file://add_puppet_gemspec.patch \
>       file://puppet.conf \
> +    file://maint-Change-spec-test-to-pass-on-ruby-2.2.patch \
> +    file://MAINT-Fix-duplicate-key-which-ruby-2.2-complains-abo.patch \
> +    file://safe_yaml-syck-isn-t-available-for-Ruby-2.0.0.patch \
>   "
>   SRC_URI[md5sum] = "cc294da1d51df07bcc7f6cf78bd90ce0"
>   SRC_URI[sha256sum] = "4a3bd7ddb51072c3dd898a8de158cde204a2d8fd0b84e8ac806b84c074348637"
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-21  2:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20 20:14 [m-c-s][PATCH] puppet: back-port some patches to fix issues with Ruby >= 2.0.0 Mark Asselstine
2015-08-21  2:56 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.