summaryrefslogtreecommitdiff
path: root/lib/chef/shell.rb
diff options
context:
space:
mode:
authorMarc Chamberland <mchamberland@pbsc.com>2019-06-03 22:15:16 -0400
committerMarc Chamberland <mchamberland@pbsc.com>2019-06-03 23:05:49 -0400
commit7eda1e5bf3f71c00bd08bde20a03b817caf95095 (patch)
tree0c6ea467b4e4af4acbadf7ab777a7ef4bd19cb8e /lib/chef/shell.rb
parent8ab574c75ada5112b89149cc63b3a4f007664974 (diff)
downloadchef-7eda1e5bf3f71c00bd08bde20a03b817caf95095.tar.gz
more distro constants
Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
Diffstat (limited to 'lib/chef/shell.rb')
-rw-r--r--lib/chef/shell.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index f8a8dfdca2..d81b2eb910 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -206,17 +206,17 @@ module Shell
@footer
end
- banner("chef-shell #{Chef::VERSION}\n\nUsage: chef-shell [NAMED_CONF] (OPTIONS)")
+ banner("#{Chef::Dist::SHELL} #{Chef::VERSION}\n\nUsage: #{Chef::Dist::SHELL} [NAMED_CONF] (OPTIONS)")
footer(<<~FOOTER)
- When no CONFIG is specified, chef-shell attempts to load a default configuration file:
- * If a NAMED_CONF is given, chef-shell will load ~/.chef/NAMED_CONF/chef_shell.rb
- * If no NAMED_CONF is given chef-shell will load ~/.chef/chef_shell.rb if it exists
- * If no chef_shell.rb can be found, chef-shell falls back to load:
- /etc/chef/client.rb if -z option is given.
- /etc/chef/solo.rb if --solo-legacy-mode option is given.
- .chef/config.rb if -s option is given.
- .chef/knife.rb if -s option is given.
+ When no CONFIG is specified, #{Chef::Dist::SHELL} attempts to load a default configuration file:
+ * If a NAMED_CONF is given, #{Chef::Dist::SHELL} will load ~/#{Chef::Dist::USER_CONF_DIR}/NAMED_CONF/#{Chef::Dist::SHELL_CONF}
+ * If no NAMED_CONF is given #{Chef::Dist::SHELL} will load ~/#{Chef::Dist::USER_CONF_DIR}/#{Chef::Dist::SHELL_CONF} if it exists
+ * If no #{Chef::Dist::SHELL_CONF} can be found, #{Chef::Dist::SHELL} falls back to load:
+ #{Chef::Dist::CONF_DIR}/client.rb if -z option is given.
+ #{Chef::Dist::CONF_DIR}/solo.rb if --solo-legacy-mode option is given.
+ #{Chef::Dist::USER_CONF_DIR}/config.rb if -s option is given.
+ #{Chef::Dist::USER_CONF_DIR}/knife.rb if -s option is given.
FOOTER
option :config_file,
@@ -330,18 +330,18 @@ module Shell
config[:config_file]
elsif environment
Shell.env = environment
- config_file_to_try = ::File.join(dot_chef_dir, environment, "chef_shell.rb")
+ config_file_to_try = ::File.join(dot_chef_dir, environment, Chef::Dist::SHELL_CONF)
unless ::File.exist?(config_file_to_try)
- puts "could not find chef-shell config for environment #{environment} at #{config_file_to_try}"
+ puts "could not find #{Chef::Dist::SHELL} config for environment #{environment} at #{config_file_to_try}"
exit 1
end
config_file_to_try
- elsif dot_chef_dir && ::File.exist?(File.join(dot_chef_dir, "chef_shell.rb"))
- File.join(dot_chef_dir, "chef_shell.rb")
+ elsif dot_chef_dir && ::File.exist?(File.join(dot_chef_dir, Chef::Dist::SHELL_CONF))
+ File.join(dot_chef_dir, Chef::Dist::SHELL_CONF)
elsif config[:solo_legacy_shell]
- Chef::Config.platform_specific_path("/etc/chef/solo.rb")
+ Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/solo.rb")
elsif config[:client]
- Chef::Config.platform_specific_path("/etc/chef/client.rb")
+ Chef::Config.platform_specific_path("#{Chef::Dist::CONF_DIR}/client.rb")
elsif config[:solo_shell]
Chef::WorkstationConfigLoader.new(nil, Chef::Log).config_location
else