diff options
-rwxr-xr-x | chef-bin/bin/chef-service-manager | 1 | ||||
-rw-r--r-- | lib/chef/application.rb | 6 | ||||
-rw-r--r-- | lib/chef/cookbook_site_streaming_uploader.rb | 3 | ||||
-rw-r--r-- | lib/chef/deprecation/warnings.rb | 3 | ||||
-rw-r--r-- | lib/chef/dist.rb | 4 | ||||
-rw-r--r-- | lib/chef/exceptions.rb | 2 | ||||
-rw-r--r-- | lib/chef/shell/ext.rb | 2 |
7 files changed, 14 insertions, 7 deletions
diff --git a/chef-bin/bin/chef-service-manager b/chef-bin/bin/chef-service-manager index 2cf0256528..64cc043a54 100755 --- a/chef-bin/bin/chef-service-manager +++ b/chef-bin/bin/chef-service-manager @@ -21,6 +21,7 @@ $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "chef" require "chef/application/windows_service_manager" +require "chef/dist" if Chef::Platform.windows? chef_client_service = { diff --git a/lib/chef/application.rb b/lib/chef/application.rb index bffa6ba909..197ae20c6d 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -343,7 +343,7 @@ class Chef exit 0 end end - logger.trace "Fork successful. Waiting for new chef pid: #{pid}" + logger.trace "Fork successful. Waiting for new #{Chef::Dist::CLIENT} pid: #{pid}" result = Process.waitpid2(pid) handle_child_exit(result) logger.trace "Forked instance successfully reaped (pid: #{pid})" @@ -355,9 +355,9 @@ class Chef return true if status.success? message = if status.signaled? - "Chef run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})" + "#{Chef::Dist::PRODUCT} run process terminated by signal #{status.termsig} (#{Signal.list.invert[status.termsig]})" else - "Chef run process exited unsuccessfully (exit code #{status.exitstatus})" + "#{Chef::Dist::PRODUCT} run process exited unsuccessfully (exit code #{status.exitstatus})" end raise Exceptions::ChildConvergeError, message end diff --git a/lib/chef/cookbook_site_streaming_uploader.rb b/lib/chef/cookbook_site_streaming_uploader.rb index dd9cf8fa39..6719ad370b 100644 --- a/lib/chef/cookbook_site_streaming_uploader.rb +++ b/lib/chef/cookbook_site_streaming_uploader.rb @@ -22,6 +22,7 @@ require "uri" unless defined?(URI) require "net/http" unless defined?(Net::HTTP) require "mixlib/authentication/signedheaderauth" require "openssl" unless defined?(OpenSSL) +require_relative "dist" class Chef # == Chef::CookbookSiteStreamingUploader @@ -36,7 +37,7 @@ class Chef class << self def create_build_dir(cookbook) - tmp_cookbook_path = Tempfile.new("chef-#{cookbook.name}-build") + tmp_cookbook_path = Tempfile.new("#{Chef::Dist::SHORT}-#{cookbook.name}-build") tmp_cookbook_path.close tmp_cookbook_dir = tmp_cookbook_path.path File.unlink(tmp_cookbook_dir) diff --git a/lib/chef/deprecation/warnings.rb b/lib/chef/deprecation/warnings.rb index 7120b87f43..ae521ac48e 100644 --- a/lib/chef/deprecation/warnings.rb +++ b/lib/chef/deprecation/warnings.rb @@ -21,11 +21,12 @@ class Chef module Warnings require_relative "../version" + require_relative "../dist" def add_deprecation_warnings_for(method_names) method_names.each do |name| define_method(name) do |*args| - message = "Method '#{name}' of '#{self.class}' is deprecated. It will be removed in Chef #{Chef::VERSION.to_i.next}." + message = "Method '#{name}' of '#{self.class}' is deprecated. It will be removed in #{Chef::Dist::PRODUCT} #{Chef::VERSION.to_i.next}." message << " Please update your cookbooks accordingly." Chef.deprecated(:internal_api, message) super(*args) diff --git a/lib/chef/dist.rb b/lib/chef/dist.rb index 073f61007b..03c4fdc7f8 100644 --- a/lib/chef/dist.rb +++ b/lib/chef/dist.rb @@ -21,6 +21,10 @@ class Chef # The chef executable, as in `chef gem install` or `chef generate cookbook` EXEC = ChefConfig::Dist::EXEC.freeze + # A short name for the project, used in configurations + # Log messages, descriptions, etc... + SHORT = "chef".freeze + # product website address WEBSITE = "https://chef.io".freeze diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 40d20cc3ac..d1317cec69 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -475,7 +475,7 @@ class Chef class CookbookChefVersionMismatch < RuntimeError def initialize(chef_version, cookbook_name, cookbook_version, *constraints) constraint_str = constraints.map { |c| c.requirement.as_list.to_s }.join(", ") - super "Cookbook '#{cookbook_name}' version '#{cookbook_version}' depends on chef version #{constraint_str}, but the running chef version is #{chef_version}" + super "Cookbook '#{cookbook_name}' version '#{cookbook_version}' depends on #{Chef::Dist::PRODUCT} version #{constraint_str}, but the running #{Chef::Dist::PRODUCT} version is #{chef_version}" end end diff --git a/lib/chef/shell/ext.rb b/lib/chef/shell/ext.rb index b62b87ac6d..fd978e0aa7 100644 --- a/lib/chef/shell/ext.rb +++ b/lib/chef/shell/ext.rb @@ -208,7 +208,7 @@ module Shell end alias :halp :help - desc "prints information about chef" + desc "prints information about #{Chef::Dist::PRODUCT}" def version puts "This is the #{Chef::Dist::SHELL}.\n" + " #{Chef::Dist::PRODUCT} Version: #{::Chef::VERSION}\n" + |