summaryrefslogtreecommitdiff
path: root/omnibus_overrides.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-12-04 19:33:45 -0800
committerTim Smith <tsmith@chef.io>2018-12-04 21:23:46 -0800
commitcf68b2d40d99fdb4ed1a98cf9c80a9e6bf78fcb6 (patch)
treebaf02032b6423c6c80ea98eb132b2296cddc1d2a /omnibus_overrides.rb
parent79d9111b0171312c0a6e065f3a4de5b53bc1ecf5 (diff)
downloadchef-cf68b2d40d99fdb4ed1a98cf9c80a9e6bf78fcb6.tar.gz
Fix locking ohai to to the value in the Gemfile.lock
Round 2 Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'omnibus_overrides.rb')
-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