diff --git a/oc-chef-pedant/lib/pedant/request.rb b/oc-chef-pedant/lib/pedant/request.rb index 2e4a66362a..7ebae6da5e 100644 --- a/oc-chef-pedant/lib/pedant/request.rb +++ b/oc-chef-pedant/lib/pedant/request.rb @@ -22,6 +22,7 @@ module Request require "rest_client" require "mixlib/shellout" unless defined?(Mixlib::ShellOut) require "uuidtools" + require "pedant/config" include Pedant::JSON # TODO: alternative suggestions? @@ -36,8 +37,7 @@ def server_api_version # Grab the the version of Chef / Knife that's on the box in order # to properly set the X-Chef-Version header - KNIFE_VERSION = "18.8.46" # This version should be updated manually to point to valid chef release. - # FYI, this must be a valid, shipping version of Chef, or the server will reject requests. + KNIFE_VERSION = Pedant::Config.knife_version # Headers that are added to all requests def standard_headers diff --git a/omnibus/files/server-ctl-cookbooks/infra-server/templates/default/pedant_config.rb.erb b/omnibus/files/server-ctl-cookbooks/infra-server/templates/default/pedant_config.rb.erb index 797b0ab58b..6c8812fd3a 100644 --- a/omnibus/files/server-ctl-cookbooks/infra-server/templates/default/pedant_config.rb.erb +++ b/omnibus/files/server-ctl-cookbooks/infra-server/templates/default/pedant_config.rb.erb @@ -204,3 +204,6 @@ role "<%= @role %>" include_version_in_status <%= node['private_chef']['opscode-erchef']['include_version_in_status'] %> include_x_ops_api_info <%= node['private_chef']['opscode-erchef']['include_x_ops_api_info'] %> + +# Chef/knife version number required in request.rb +knife_version "18.8.46" # Bump this as needed