[DRE-commits] [chef] 01/02: fix usage of the ohai resource with the version of ohai in Jessie

Antonio Terceiro terceiro at moszumanska.debian.org
Fri Nov 13 11:38:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch debian/jessie
in repository chef.

commit 7fc3b1e384118183acc3632119aed1f5097b4722
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Fri Nov 13 09:12:58 2015 -0200

    fix usage of the ohai resource with the version of ohai in Jessie
    
    Closes: #804911
---
 debian/changelog                                  |  7 ++++++
 debian/patches/series                             |  1 +
 debian/patches/support-ohai-6.diff                | 26 +++++++++++++++++++++++
 debian/tests/cookbooks/example/recipes/default.rb |  4 ++++
 4 files changed, 38 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c725f78..d0fd82b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+chef (11.12.8-3) jessie; urgency=medium
+
+  * debian/patches/support-ohai-6.diff: fix usage of the ohai resource with
+    the version of ohai in Jessie(Closes: #804911)
+
+ -- Antonio Terceiro <terceiro at debian.org>  Fri, 13 Nov 2015 09:11:35 -0200
+
 chef (11.12.8-2) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/series b/debian/patches/series
index 0a49035..bc1513e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 remove_rubygems.diff
+support-ohai-6.diff
diff --git a/debian/patches/support-ohai-6.diff b/debian/patches/support-ohai-6.diff
new file mode 100644
index 0000000..822938e
--- /dev/null
+++ b/debian/patches/support-ohai-6.diff
@@ -0,0 +1,26 @@
+Description: Fix usage of the ohai resource against ohai 6.x
+ The version of chef in Jessie was supposed to be used with ohai 7.x or later,
+ which has a different API, but at the time the metadata checks weren't in
+ place so this was caught before the release.
+Author: Antonio Terceiro <terceiro at debian.org>
+Origin: vendor
+Bug-Debian: https://bugs.debian.org/804911
+Forwarded: not-needed
+Last-Update: 2015-11-13
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/chef/provider/ohai.rb
++++ b/lib/chef/provider/ohai.rb
+@@ -34,11 +34,7 @@ class Chef
+         converge_by("re-run ohai and merge results into node attributes") do
+           ohai = ::Ohai::System.new
+ 
+-          # If @new_resource.plugin is nil, ohai will reload all the plugins
+-          # Otherwise it will only reload the specified plugin
+-          # Note that any changes to plugins, or new plugins placed on
+-          # the path are picked up by ohai.
+-          ohai.all_plugins @new_resource.plugin
++          ohai.all_plugins
+           node.automatic_attrs.merge! ohai.data
+           Chef::Log.info("#{@new_resource} reloaded")
+         end
diff --git a/debian/tests/cookbooks/example/recipes/default.rb b/debian/tests/cookbooks/example/recipes/default.rb
index ec81598..2882bff 100644
--- a/debian/tests/cookbooks/example/recipes/default.rb
+++ b/debian/tests/cookbooks/example/recipes/default.rb
@@ -1 +1,5 @@
 package 'vim'
+
+ohai 'reload' do
+  action :reload
+end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/chef.git



More information about the Pkg-ruby-extras-commits mailing list