summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-12-04 22:05:38 -0800
committerGitHub <noreply@github.com>2018-12-04 22:05:38 -0800
commit5b50a80b2609487b42b00fe27ae6e8e01640204e (patch)
treebaf02032b6423c6c80ea98eb132b2296cddc1d2a
parent79d9111b0171312c0a6e065f3a4de5b53bc1ecf5 (diff)
parentcf68b2d40d99fdb4ed1a98cf9c80a9e6bf78fcb6 (diff)
downloadchef-5b50a80b2609487b42b00fe27ae6e8e01640204e.tar.gz
Merge pull request #8014 from chef/fix_gemlock
Fix locking ohai to to the value in the Gemfile.lock
-rw-r--r--omnibus_overrides.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb
index 4b1fa0163d..d3ee80b78a 100644
--- a/omnibus_overrides.rb
+++ b/omnibus_overrides.rb
@@ -24,7 +24,10 @@ override "xproto", version: "7.0.28"
override "zlib", version: "1.2.11"
override "openssl", version: "1.0.2q"
-# this pins the ohai omnibus definition ohai version to the same version that's
-# in the gemfile.lock, which is what the chef defition will end up using. If we
-# don't pin in this file we get master, which isn't the released version (usually)
-override "ohai", version: ::File.readlines("Gemfile.lock", File.expand_path(File.dirname(__FILE__))).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; $1
+# we build both a chef and ohai omnibus-software defintion which create the
+# chef-client and ohai binstubs. Out of the box the ohai definition uses whatever
+# is in master, which won't match what's in the Gemfile.lock and used by the chef
+# definition. This pin will ensure that ohai and chef-client commands use the
+# same (released) version of ohai.
+gemfile_lock = File.join(File.expand_path(File.dirname(__FILE__)), "Gemfile.lock")
+override "ohai", version: "#{::File.readlines(gemfile_lock).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; 'v' + $1}" # rubocop: disable Layout/SpaceInsideStringInterpolation