summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-12-04 19:33:45 -0800
committerTim Smith <tsmith@chef.io>2018-12-05 14:58:40 -0800
commitee07d1b58eb17c667742e9aae055556864281e91 (patch)
treeaa04da460de26ecf14a05f63e945173b3eb7a561
parent3110d75462ebe5819d7d26c0ba95cbbaca17ef3e (diff)
downloadchef-correct_ohai.tar.gz
Fix locking ohai to to the value in the Gemfile.lockcorrect_ohai
Round 2 Signed-off-by: Tim Smith <tsmith@chef.io>
-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