From cf68b2d40d99fdb4ed1a98cf9c80a9e6bf78fcb6 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 4 Dec 2018 19:33:45 -0800 Subject: Fix locking ohai to to the value in the Gemfile.lock Round 2 Signed-off-by: Tim Smith --- omnibus_overrides.rb | 11 +++++++---- 1 file 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 -- cgit v1.2.1